On 2/21/07, John Summerfield <[EMAIL PROTECTED]> wrote:

> cat ifcfg-*4000 | sed 's/.96.70/.96.71/' | > ifcfg-qeth-bus-ccw-0.0.4010

So you don't mind if 196370 gets changed?

Yes, the period as wildcard has bitten me before and did not make a
good example (and I do escape them when I have to). And I *was*
writing to a new file so there was no real need for the bak files. But
I learned that with bash I cannot write the file that I am reading...

The real gotcha I wanted to point out here was the semantical
difference. With CMS Pipelines this creates a new file 4010 with the
modified contents of 4000. But with bash this does not leave
anything...   as I understand because this pipes into no program and
then redirects the output of that no program. Useless, but
syntactically correct. With CMS Pipelines the ">" is the program, sort
of.

Being in a hurry doing lots of servers (pasting the same thing into
the command line) and you start to suspect all kind of things when it
does not work.

When available (and when I can recall the command) I prefer to use
perl for such things:

perl -i.bak -p -e 's/old string/new string/'  files...

Rob

----------------------------------------------------------------------
For LINUX-390 subscribe / signoff / archive access instructions,
send email to [EMAIL PROTECTED] with the message: INFO LINUX-390 or visit
http://www.marist.edu/htbin/wlvindex?LINUX-390

Reply via email to