I am trying to write a Unix Shell script that will act as a wrapper
for a binary. It needs to do x, y, then call the binary with the EXACT
arguments that the script was executed with. The format of the
arguments cannot be changed (i.e.- escaping characters) because this
is hard-coded into many scripts, and it would be very time-consuming
to edit every script and add any escaping. The program is as follows:
#! /bin/sh
# do x
# ...
# do y
# ...
# load the binary and pass all arguments
/path/to/binary/my.binary $*
The wrapper is called like this:
/path/to/my.script --set-defaults=/some/path/my.conf -e'this text is
executed in the binary'
but what is actually getting executed (passed to the binary) is:
/path/to/my.script --set-defaults=/some/path/my.conf -ethis text is
executed in the binary
The shell is stripping the quotes from the argument before the script
can do any processing on it, such as doing a pattern match and
substitution to insert escape characters. Is there a way to disable
interpretation of arguments? I tried using the noglob option:
#! /bin/sh -f
but still had the same results. Any help would be greatly appreciated,
I've been trying to find a way to do this all day.
(The system is SunOS version 8)