I am trying to replace all occurrences of
<value>file:\\</value> in a designated file
I work on Windows and use
sed I have installed with Win-32 compiled set of bash utils.
I use a following command:
sed -n "s/<value>.*<\/value>/<value>file:\\\\<\/value>/g" "test.txt" > "test.txt.new"
I want to run this command as a part of Wpkg script.
When I use this command from commandline, everything works properly.
But when I use this command via Wpkg script:
<install cmd='%BASH%\sed -n "s/<value>.*<\/value>/<value>file:\\\\<\/value>/g;" test.txt" > "test.txt new"' />
...then what I get is:
Exit code returned non-successful value (2) on command '%BASH%\sed -n "s/<value> .*<\/value>/<value>file:\\\\<\/value>/g;" "test.txt" > "test.txt.new"'.
The above means that
sed application returned exit code 2. Additionaly, the new file has not been created.
I browsed google for a really long time and to my surprise,
sed seems to have a pretty poor documentation. I have found no documentation regarding this exit code.
Anyone got a clue what does exit code 2 mean for
...or an alternative solution?
(must be unattended, pretty sure might use common bash tools)