#!/bin/bash
while getopts n:a: OPT
do
case "${OPT}"
in
n) name=${OPTARG};;
a) age=${OPTARG};;
*) echo "Invalid option"
exit 1;;
esac
done
printf "My name is $name and I am $age years old\n"
Preview:
downloadDownload PNG
downloadDownload JPEG
downloadDownload SVG
Tip: You can change the style, width & colours of the snippet with the inspect tool before clicking Download!
Click to optimize width for Twitter