[go: up one dir, main page]

Skip to content
forked from kakwa/mk-sh-skel

just a simple script skeleton initializer

License

Notifications You must be signed in to change notification settings

atisne/mk-sh-skel

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

36 Commits
 
 
 
 
 
 
 
 

Repository files navigation

mk-sh-skel

just a simple script skeleton initializer

License

mk-sh-skel is released under the MIT Public License

Installation

Quick and dirty:

rm -f /usr/local/bin/mksh-skel
curl https://raw.githubusercontent.com/kakwa/mk-sh-skel/master/mksh-skel \
-o /usr/local/bin/mksh-skel
chmod 755 /usr/local/bin/mksh-skel
#end

Cleaner:

# after recovering the sources
make install # PREFIX=/usr/local/ DESTDIR=./buildroot/

Usage

It's quite simple:

mksh-skel -n <path/to/new/script>

Skeleton output

It generates a basic skeleton with help and getopts

#!/bin/sh

help(){
  cat <<EOF
usage: `basename $0` <args>

<description>

arguments:
  <options>
EOF
  exit 1
}

while getopts ":hn:" opt; do
  case $opt in
    h)  help;;
    n)  NAME="$OPTARG";;
    \?) echo "Invalid option: -$OPTARG" >&2 ;help; exit 1 ;;
    :)  echo "Option -$OPTARG requires an argument." >&2; help; exit 1;;
  esac
done

About

just a simple script skeleton initializer

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Shell 88.8%
  • Makefile 11.2%