Quoting Holden Hao ([EMAIL PROTECTED]):
> Its just that the syntax is cryptic to me and it seems intimidating.
> I want to learn a little sed to do some search and replace.
sed and awk are nice because you can prototype the results before
committing to them. Say you want to change the "foo" in each filename
to a "bar":
ls foo*jpeg | awk '{print("mv "$1" "$1)}' | sed 's/foo/bar/2'
Then you get the output. Looks correct, yet, or not yet quite right?
When it is, pipe it through a shell.
ls foo*jpeg | awk '{print("mv "$1" "$1)}' | sed 's/foo/bar/2' | /bin/sh
While there's many ways of doing such tasks, few offer the ability to
prototype, like this.
Besides, Perl tends to annoy me by grabbing all my RAM for no adequate
reason. Early today, my neighbourhood had a seven-hour power outage,
caused by a Pacific storm. When the power came back on, Spamassassin
(a Perl script) grabbed so much of my server's RAM while grinding
through the avalanche of deferred mail that it killed Apache and sshd.
Grrr. sed and awk have never done that to me!
--
Cheers, We write precisely We say exactly
Rick Moen Since such is our habit in How to do a thing or how
[EMAIL PROTECTED] Talking to machines; Every detail works.
Excerpt from Prof. Touretzky's decss-haiku.txt @ http://www.cs.cmu.edu/~dst/
_
Philippine Linux Users Group. Web site and archives at http://plug.linux.org.ph
To leave: send "unsubscribe" in the body to [EMAIL PROTECTED]
Fully Searchable Archives With Friendly Web Interface at http://marc.free.net.ph
To subscribe to the Linux Newbies' List: send "subscribe" in the body to
[EMAIL PROTECTED]