Hi,
I facing some problem while doing sed .
I have simple script.
#!/bin/sh
set -x
set -v
Test1=""
sed -e s/dbccons_sparc/dbccons_linux/ \
-e s/\${SOLARISMACH}/${Test1}/ \
-e s+'\"[ \t]*<<'+' \t<<'+ \
-e s/\"\${DBCCONS}/\${DBCCONS}/ \
-e s+'\"[ \t]*\\'+' \t\\'+ \
-e s/rsh/${Test1}/ test.res > test.output
its executing fine but when I edit that script without any change and then saving it and compiling its throwing error.
+ set -v
Test1=""
+ Test1=
sed -e s/dbccons_sparc/dbccons_linux/ \
-e s/\${SOLARISMACH}/${Test1}/ \
-e s+'\"[ \t]*<<'+' \t<<'+ \
-e s/\"\${DBCCONS}/\${DBCCONS}/ \
-e s+'\"[ \t]*\\'+' \t\\'+ \
+ sed -e s/dbccons_sparc/dbccons_linux/ -e 's/${SOLARISMACH}//' -e 's+\"[ \t]*<<+ \t<<+' -e 's/"${DBCCONS}/${DBCCONS}/' -e 's+\"[ \t]*\\+ \t\\+' ' '
sed: can't read : No such file or directory
-e s/rsh/${Test1}/ test.res > test.output
+ -e s/rsh// test.res
./sample.sh: line 11: -e: command not found
Not getting where is problem in my script..
please help.
thanks,
Bhrat kapoor
---------- Post updated at 06:41 PM ---------- Previous update was at 06:33 PM ----------
Okay ..Please help on this
---------- Post updated at 06:55 PM ---------- Previous update was at 06:41 PM ----------
Same problem :
#!/bin/sh
sed -e s/dbccons_sparc/dbccons_linux/ \
-e s/rsh/no/ test1.res > test1.output
test1.res contain :
rsh dbccons_sparc
but when I am just editing without any changes its throwing error.
+ set -v
sed -e s/dbccons_sparc/dbccons_linux/ \
+ sed -e s/dbccons_sparc/dbccons_linux/ ' '
sed: can't read : No such file or directory
-e s/rsh/no/ test1.res > test1.output
+ -e s/rsh/no/ test1.res
./sample1.sh: line 6: -e: command not found