function weather() { if [[ "$2" = "--now" || "$2" = "-n" ]] ; then curl -s -N "wttr.in/$1" | head -n 7 #| tail -n 5 elif [ "$2" = "--today" ] ; then curl -s -N "http://wttr.in/$1" | head -n 1 curl -s -N "http://wttr.in/$1" | head -n 17 | tail -n 10 elif [ "$2" = "--tomorrow" ] ; then curl -s -N "http://wttr.in/$1" | head -n 1 curl -s -N "http://wttr.in/$1" | head -n 27 | tail -n 10 elif [ "$2" = "--day-after-tomorrow" ] ; then curl -s -N "http://wttr.in/$1" | head -n 1 curl -s -N "http://wttr.in/$1" | head -n 37 | tail -n 10 else curl -s "http://wttr.in/$1" | head -n 37 fi }