Skip to content

Instantly share code, notes, and snippets.

@Igneous
Created January 21, 2011 23:59
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 Igneous/790673 to your computer and use it in GitHub Desktop.
Save Igneous/790673 to your computer and use it in GitHub Desktop.
#!/bin/bash
# Takes three args: <day> <month(s)> <year>
echo $1 $2 $3
echo "Day: $1"
OLDIFS="$IFS"
IFS=',' read -ra months <<< "$2"
IFS="$OLDIFS"
if [[ "${#months[@]}" -gt "1" ]];then
for i in $(seq 0 $((${#months[@]} - 1)));do
echo "Month #$i: ${months[$i]}"
done
else
echo "Month: $2"
fi
echo "Year: $3"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment