Article View: comp.unix.shell
Article #289sed help needed
From: Laura Taylor
Date: Tue, 04 Aug 1992 16:20
Date: Tue, 04 Aug 1992 16:20
23 lines
1100 bytes
1100 bytes
i figured out the answer to the last question i posted myself:
set result = `grep "search string" searchfile | awk '{print $3}' | uniq`
piping through uniq was the ticket.
however, now a new problem arises.
my variable $result = /some/long/unix/directory
i want to use sed to replace it with /some/other/long/unix/directory
the sed command should be something like this:
sed s/$result/"/some/other/long/unix/directory"/ searchfile > newfile
however this doesn't work. the problem is definitely related to the
"/"es in the unix tree names. anyone know what is wrong with this
sed string?
Thanks,
/laura
Technical Details
Message-ID:
<15mao8INN6ee@seven-up.East.Sun.COM>Path:
arc1-ca.pugleaf.net!sparky!uunet!charon.amdahl.com!pacbell.com!mips!swrinde!cs.utexas.edu!sun-barr!news2me.ebay.sun.com!seven-up.East.Sun.COM!blinky!ltaylorShow Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!sparky!uunet!charon.amdahl.com!pacbell.com!mips!swrinde!cs.utexas.edu!sun-barr!news2me.ebay.sun.com!seven-up.East.Sun.COM!blinky!ltaylor From: ltaylor@blinky.East.Sun.COM (Laura Taylor) Newsgroups: comp.unix.shell Subject: sed help needed Message-ID: <15mao8INN6ee@seven-up.East.Sun.COM> Date: 4 Aug 92 16:20:24 GMT Organization: Sun Microsystems Inc, Mt. View, CA, USA Lines: 23 NNTP-Posting-Host: blinky.east.sun.com Originator: ltaylor@blinky