[Vm-dev] [OpenSmalltalk/opensmalltalk-vm] Allow choosing an image via zenity when no arguments are provided (#408)
Eliot Miranda
notifications at github.com
Sat Jun 29 00:50:40 UTC 2019
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 or view it on GitHub:
https://github.com/OpenSmalltalk/opensmalltalk-vm/pull/408#issuecomment-506913304
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.squeakfoundation.org/pipermail/vm-dev/attachments/20190628/71d0de50/attachment.html>
More information about the Vm-dev
mailing list