Sometime Today, Binand Raj S. assembled some asciibets to say:

> sed -e 's,\(/usr\)\(/bin\),\1/local\2,g'

Why the grouping parens?  avoid spelling mistakes?  I prefer the |
character.  It's more visible.

Mayuresh, if you post exactly what went wrong, we may be able to figure
out what was wrong.

My suggestion would be, instead of replacing with /usr/local/bin,
replace with something like BINPATH:

tmpfile=`mktemp XXXXXX`
for i in *.[ch]; do
    cat $i | sed -e 's|/usr/bin|BINPATH|g' > $tmpfile
    cp $tmpfile $i
done;
rm $tmpfile

Note, you cannot redirect output back to $i, it will clobber the file
before reading it.

Then, you have a common #included file, that #defines BINPATH to
whatever you want.

Philip

-- 
Weaseling out of things is important to learn.  It's what separates us
from the animals.  Except the weasel.

                -- Homer Simpson
                   Boy-Scoutz n the Hood


Visit my webpage at http://www.ncst.ernet.in/~philip/
Read my writings at http://www.ncst.ernet.in/~philip/writings/

  MSN  philiptellis                         Yahoo!  philiptellis
  AIM  philiptellis                         ICQ     129711328



_______________________________________________
linux-india-help mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/linux-india-help

Reply via email to