Hi Leon,
alas I think this way will fail:
if [ $# -eq 0 && which zenity &>/dev/null ]; then
VM_ARGS=$(zenity --title 'Select an image' --file-selection --file-filter '.image' --file-filter '')
else
VM_ARGS=$@
fi
LD_LIBRARY_PATH="$PLUGINS:$SVMLLP:${LD_LIBRARY_PATH}" exec $GDB "$BIN/squeak" "${VM_ARGS}"
That's illustrated by the following test programme:
-----------8<-------------
#!/bin/bash
ARGS=$@
echo; echo A
for a in "$ARGS"; do
echo $a
done
ARGS="$@"
echo; echo B
for a in "$ARGS"; do
echo $a
done
ARGS="$@"
echo; echo C
for a in $ARGS; do
echo $a
done
ARGS=$@
echo; echo D
for a in $ARGS; do
echo $a
done
-----------8<-------------
If one invokes this with ./testshellargs.sh 'arg one' 'arg two' then the output is
A
arg one arg two
B
arg one arg two
C
arg
one
arg
two
D
arg
one
arg
two
We have to find some way of writing this so that the output is
YES!!!
arg one
arg two
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub, or mute the thread.