Thank you!
So if I understand correctly, brewbuck suggested to modify the source code of the executable to parse its arguments with nonspace charater as the separator instead? Is there a way without modifying the source code of the executable?
The reason why I don't use "$@" is that the arguments to the bash script is not completely those for the executable. Some of them are just arguments only to the bash script. So actually the script is like
Code:
#!/bin/bash
DEBUGGER=""
ARG_OPTS=""
while [[ -n "$1" ]];
case $1 in
--run)
make clean
make -j -k || exit 1
DEBUGGER=""
;;
--gdb)
make clean
make -j -k DEBUG=yes || exit 1
DEBUGGER="gdb --args"
;;
*)
ARG_OPTS="${ARG_OPTS} $1"
;;
esac
shift
done
${DEBUGGER} my_executable ${ARG_OPTS}