Results 1 to 2 of 2
hi All,
here is my problem
I try to use "sed" command as followig but I got error!
path=(`pwd`)
.
.
sed 's/home\/aruna\/WORK\/GUI_test\/testharness/($path)/g' run.tcl >> run1.tcl
I cann't figure out ...
- 03-17-2008 #1Just Joined!
- Join Date
- Mar 2008
- Posts
- 10
Problem in using sed commnad in bash program.
hi All,
here is my problem
I try to use "sed" command as followig but I got error!
path=(`pwd`)
.
.
sed 's/home\/aruna\/WORK\/GUI_test\/testharness/($path)/g' run.tcl >> run1.tcl
I cann't figure out what is the problem with this. When I print path on screen it was having a correct value.
I think the problem is that path is having "/" characters inside it.
can you please give me a solution for this?
Thanks,
Aruna.
- 03-17-2008 #2Linux User
- Join Date
- Jun 2007
- Posts
- 318
That's right, the slash is causing you problems since you're using it as the delimiter in the substitute command in sed. Use something that probably won't appear in the pathname like %
Also, use double quotes instead of single quotes. Single quotes prevent variable expansion. Also, the ()'s aren't needed.Code:sed "s%home\/aruna\/WORK\/GUI_test\/testharness%$path%g" run.tcl >> run1.tcl


Reply With Quote