I have this piece of sh code which takes one argument at a time:
#!/bin/sh
clear
if [ $# -eq 0 ]
then
echo -n "There are no arguments. Please try again with arguments."
echo
exit
elif [ ! -f "$*" ]
then
echo -n "The image file '$*' doesn't exist!"
echo
exit
else
display -size 40x50 $*
fi
How would I be able to make it print out up to 5 arguments therefore show 5 thumbnails at the same time?
After the
elsestatement use aforloop to go over the input:The trick is to use
&which makes the current task go to the background.