Getopts for process pipelines
# list recently modified files
lr() {
pipeopts "adl|n:c:" "$*"
ls -t ${PIPEOPTS[0]} | head ${PIPEOPTS[1]}
}
# now run it
lr -aln25
pipeopts
is a Bash builtin that helps you pass arguments to process pipelines.
Internal Bash functions, useful when writing loadable builtins: https://gist.github.com/sshaw/8017032