igotlongestname has asked for the wisdom of the Perl Monks concerning the following question:
I have an understanding of the -n putting the code in a loop, the -i allowing to write to the same file, and the -e letting the command line act like code. I'm having trouble seeing what each Perl code "line" (the stuff between the ;'s) does, as well as if s+ was syntax for substitute or something else. If anyone can give a quick synopsis of what's going on I'd be quite grateful. Thanks!perl -ni -e's+${SOURCE}/${SAMS}/++g;s+${SOURCE}/${SAMLIB}/++g;s+${SOUR +CE}/${SMCLIB}/+${SOURCE}/${KENO}/+g;if ( not m+^${SOURCE}/+ ) {s+${SO +URCE}/+\$$\{OBJECT\}/+g;print}' .depend ;\ ${SCALE}/cmds/Sort .depend )
~Jack
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Command line question
by kyle (Abbot) on Jun 17, 2008 at 21:51 UTC | |
by ikegami (Patriarch) on Jun 17, 2008 at 23:39 UTC | |
by parv (Parson) on Jun 18, 2008 at 00:48 UTC | |
by kyle (Abbot) on Jun 18, 2008 at 00:34 UTC | |
by igotlongestname (Acolyte) on Jun 19, 2008 at 17:31 UTC | |
by kyle (Abbot) on Jun 19, 2008 at 18:58 UTC | |
|
Re: Command line question
by FunkyMonk (Bishop) on Jun 17, 2008 at 21:43 UTC |