Well this is the code I'm using for reading the arguments. I actually copied this part from another script because I liked the way it handles a varying No. of arguments as input.
Code:
# Reading arguments
unset IFS
for arg in $*; do
ARGNAME="$(echo "$arg" |cut -d= -f1)"
ARGVAL="$(echo "$arg" |cut -d= -f2)"
if ! echo "$ARGNAME" |grep -q '^-'; then
if [ -z "$SOURCE_PATH" ]; then
SOURCE_PATH="$ARGVAL"
else
if [ -z "$TARGET_PATH" ]; then
TARGET_PATH="$ARGVAL"
else
echo "Too many arguments"
show_help;
exit 1
fi
fi
#
I wasn't aware of the $@. If I understood it well enough, changing the $* to "$@" should do the trick. I'll check it out when I'm back at home again.
Thanks for pointing me to this. I've been searching my ass off trying all sort of options with IFS, awk.
Robbert