Hi
I have written a little script to change a html file. Several variables
are entered and will then be replaced in a file using sed. But this
doesn't work. I change the file menu using:
eval sed "
s/prix1/\"${prix[1]}\"/
s/prix2/\"${prix[2]}\"/
s/prix3/\"${prix[3]}\"/
s/prix4/\"${prix[4]}\"/
s/prix5/\"${prix[5]}\"/
" menu
The computer replies: ./cantine.sh: line 38: s/prix1/3,77/: No such
file or directory
./cantine.sh: line 39: s/prix2/ndggnd/: No such file or directory
./cantine.sh: line 40: s/prix3/fgsngfsn/: No such file or directory
./cantine.sh: line 41: s/prix4/sfgng/: No such file or directory
./cantine.sh: line 42: s/prix5/gnfgsn/: No such file or directory
./cantine.sh: line 43: menu: command not found
Normal, since I don't use simple quotas ' .
When I put the quotas :
eval sed '
s/prix1/\"${prix[1]}\"/
s/prix2/\"${prix[2]}\"/
s/prix3/\"${prix[3]}\"/
s/prix4/\"${prix[4]}\"/
s/prix5/\"${prix[5]}\"/
' menu
it gives the same answer. The first line is always well interpreted,
but the follows give the error messages.
How do I group sed commands together?
I use Kubuntu 6.10
Thanx
Al
----------------------------------------------------------------
This message was sent using IMP, the Internet Messaging Program.