Skip to content

Instantly share code, notes, and snippets.

View jithine's full-sized avatar

Jithin Emmanuel jithine

  • Yahoo!
  • California
  • 03:43 (UTC -07:00)
View GitHub Profile
@jithine
jithine / get_options.sh
Created September 22, 2017 21:05 — forked from deshion/get_options.sh
Parse command line options for a shell script (POSIX)
#!/bin/sh
# POSIX
# Reset all variables that might be set
file=
verbose=0 # Variables to be evaluated as shell arithmetic should be initialized to a default or validated beforehand.
while :; do
case $1 in
-h|-\?|--help) # Call a "show_help" function to display a synopsis, then exit.