- From: <
>
- To:
- Subject: [chef] Chef messing up sed commmand
- Date: Mon, 22 Apr 2013 00:48:37 -0700 (PDT)
Hi
I am trying to get a bash script to work that has a sed command in it. The
sed
command has escape characters in it. For some reason Chef seems to be taking
these escape characters out and trying to execute the sed script which fails.
The sed script works in the console
Below is the original test script I made. This works as expected.
if [ $(grep -c postrotate $1) -ne 0 ]; then
if [ $(grep -c checksum_log.sh $1) -ne 1 ]; then
sed -i 's/endscript/\/usr\/bin\/checksum_log.sh $1\n endscript/' $1
fi
fi
The Bash script block in Chef is the same as above contained within a <<-EOF
block with $1 being replaced with a file name.
The error in chef is concerning the sed command itself.
Is there any special escaping I need to do?
Thanks.
Kind Regards
Hamza Khan-Cheema
- [chef] Chef messing up sed commmand, hamza, 04/22/2013
Archive powered by MHonArc 2.6.16.