|
| i didnt get if i replace / by #
i tried lot... finally i got the answer.... we can solve in this way
also
first i tried with this....
sed
's/\/user\/xxxx\/yyyy\/zzzz\/aaaa\/bbbb\/\.cccc/\/wwww\/qqqqq\/pppp\/rrrrr\/ssss\/tttt\/\.lllll/g'
it gave error becoz it didnt accept full oldpath to newpath...
so what i did is
sed 's/user\/xxxx\/yyyy\/zzzz/ffffff/g' filename >> temporaryfile
sed 's/ffff\/aaaaa\/bbbbb\/.cccc/yyyyy/g' temporary >> temp
sed 's/yyyyy/wwww\/qqqqq\/ppppp\/rrrrr\/sssss\/tttt\/.lllllll/g' temp
mv tmpfile filename
rm temporary temp tmpfile
if i do like this am getting.... first i was so confused ..... then now
i tried like above .... i got
thanx a lot for ur response....
sk
David Bolt wrote:[vbcol=seagreen]
> On Thu, 29 Jun 2006, sk <sangeetha.kolandasamy@gmail.com> wrote:-
>
>
> Try replacing the
>
> sed "s/$oldpath/$newpath/"
>
> with
>
> sed "s#$oldpath#$newpath#"
>
> Your error is probably because the s/$oldpath/$newpath/ is expanding to
> s//user/xxxx/yyyy/zzzz/aaaa/bbbb/.cccc//wwww/qqqqq/pppp/rrrrr/ssss/tttt/.
> lllll/
>
> changing the three /'s to some other character, # in my example, means
> the / can appear as part of the search/replace string without having to
> be escaped.
>
>
> Regards,
> David Bolt
>
> --
> Member of Team Acorn checking nodes at 50 Mnodes/s: http://www.distributed.net/
> AMD1800 1Gb WinXP/SUSE 9.3 | AMD2400 256Mb SuSE 9.0 | A3010 4Mb RISCOS 3.11
> AMD2400(32) 768Mb SUSE 10.0 | Falcon 14Mb TOS 4.02 | A4000 4Mb RISCOS 3.11
> AMD2600(64) 512Mb SUSE 10.0 | | RPC600 129Mb RISCOS 3.6
|
|