unix script problem

Posted by Darie Nicolae on Server Fault See other posts from Server Fault or by Darie Nicolae
Published on 2010-06-18T13:07:06Z Indexed on 2010/06/18 13:14 UTC
Read the original article Hit count: 293

Filed under:
|
|

Hello everyone,

I have a simple script which runs on a FreeBSD machine with the following code:

#!/bin/sh
`sed -i .bak '\:#start 172.0.0.3:,\:#end 172.0.0.3:d' /usr/local/etc/racoon/racoon.conf`
echo $?

It should delete a block of text between the two patterns.

The problem is that if I run the sed command directly from shell it works, if i run the script the return code is 0.

Why's that?

© Server Fault or respective owner

Related posts about unix

Related posts about shell