Skip to content

Instantly share code, notes, and snippets.

@nemik
Created November 26, 2012 19:36
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nemik/4150147 to your computer and use it in GitHub Desktop.
Save nemik/4150147 to your computer and use it in GitHub Desktop.
NUM_PHOTOS="0"
PHOTOS[0]=""
i=0
for arg in "$@"
do
if [ "$i" == "0" ]
then
NUM_PHOTOS="$arg"
fi
PHOTOS[$i]="$arg"
i=`expr $i + 1`
done
echo "there are $NUM_PHOTOS photos"
echo "Photo 1 ${PHOTOS[1]}"
i=0
for pi in "${PHOTOS[@]}"
do
if [ "$i" == "0" ]
then
i=`expr $i + 1`
continue
fi
echo "pi $pi"
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment