Skip to content

Instantly share code, notes, and snippets.

View saschatrebbin's full-sized avatar

Sascha Trebbin saschatrebbin

View GitHub Profile
@saschatrebbin
saschatrebbin / foo.sh
Created November 23, 2017 06:39 — forked from waylan/foo.sh
Simple bash subcommands. Each subcommand is implemented as a function. For example, `sub_funcname` is called for `funcname` subcommand.
#!/bin/sh
ProgName=$(basename $0)
sub_help(){
echo "Usage: $ProgName <subcommand> [options]\n"
echo "Subcommands:"
echo " bar Do bar"
echo " baz Run baz"
echo ""