My apologies. I have not made my original mail clearer. I forgot to mention that the text file contains other data, like:
<data> ... FILE0 <more data> ... FILE1 <even more data> ... FILE2 <a whole lot more data> I just need to get these 3 markers/fields replaced before it gets processed by another program. ----- Original Message ---- From: Eduardo Tongson <[EMAIL PROTECTED]> To: Philippine Linux Users' Group (PLUG) Technical Discussion List <[email protected]> Sent: Friday, November 16, 2007 7:03:15 PM Subject: Re: [plug] scripting question Use Lawrence's solution. My one-liner did not take slashes into account. On Nov 16, 2007 5:50 PM, Michael Tinsay <[EMAIL PROTECTED]> wrote: > > How do I escape the /'s? readlink will return /foo/bar and I need to pass > it to sed as \/foo\/bar, or else sed will fail and return nothing. > > > --- mike t. > > > ----- Original Message ---- > From: Eduardo Tongson <[EMAIL PROTECTED]> > To: Philippine Linux Users' Group (PLUG) Technical Discussion List > <[email protected]> > Sent: Friday, November 16, 2007 5:25:08 PM > Subject: Re: [plug] scripting question > > You need to look at the text file first. > > for i in `cat test.txt`; do sed -i s/$i/`readlink $i`/ test.txt ; done > > > _________________________________________________ > Philippine Linux Users' Group (PLUG) Mailing List > [email protected] (#PLUG @ irc.free.net.ph) > Read the Guidelines: http://linux.org.ph/lists > Searchable Archives: http://archives.free.net.ph > _________________________________________________ Philippine Linux Users' Group (PLUG) Mailing List [email protected] (#PLUG @ irc.free.net.ph) Read the Guidelines: http://linux.org.ph/lists Searchable Archives: http://archives.free.net.ph
_________________________________________________ Philippine Linux Users' Group (PLUG) Mailing List [email protected] (#PLUG @ irc.free.net.ph) Read the Guidelines: http://linux.org.ph/lists Searchable Archives: http://archives.free.net.ph

