I wrote a sh program which when you type in the argument which is a file name of an image the program would preview it and this can take multiple arguments (as show below)
#!/bin/sh
for i in $*; do if [ ! -f "$i" ]; then
echo "invalid file $i"
else
display -size 40x50 $i &
fi
done
How would i be able to limit the number of arguments to 5?
Please help! Thanks