[SOLVED ]sed in shell script doesn't work


I have asterisk 1.4.4 installed on a fritzbox 7170. I use exten => 224,1,system,/var/asterisk/cb/test2.sh to call the following shell script


echo "test" > /var/spool/asterisk/cbtmp/testing.txt
/bin/sed -e " s/REPLACEME/$myvar/" /var/asterisk/cb/isdn3_REPLACEME.call > /var/spool/asterisk/cbtmp/t.call
#mv /var/spool/asterisk/cbtmp/t.call /var/spool/asterisk/outgoing

Calling the script from outside Asterisk works fine, calling similar scripts that don’t use sed, but just copy and move stuff, works, too. But this script yields an empty file t.call once called from the extension context. The testing.txt has the desired text - so writing to the dir as such works.

Any suggestions, why I can’t use sed ? Or is it something else ?

Cheers for the help!

usually I use sed with option -i. If you try, works?

tried with -i and did not work. :confused:

It is very strange, as it seems to not really run the command.

It was a stupid mistake.

I have Asterisk running in a chroot environment and sed was not in the bin folder…
an added " 2> file" showed me the error message and brought me the idea.

Now I am fighting with the shell environment not doing the expand_me_command behaviour, but guess that is not an Asterisk issue.

Cheers again for the help !