An open API service indexing awesome lists of open source software.

https://github.com/kakwa/mk-sh-skel

just a simple script skeleton initializer
https://github.com/kakwa/mk-sh-skel

boilerplate-template shell skeleton

Last synced: 9 months ago
JSON representation

just a simple script skeleton initializer

Awesome Lists containing this project

README

          

# mk-sh-skel #

just a simple script skeleton initializer

## License ##

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

## Installation ##

Quick and dirty:
```bash
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:
```bash
# after recovering the sources
make install # PREFIX=/usr/local/ DESTDIR=./buildroot/
```

## Usage ##

It's quite simple:

```shell
mksh-skel -n
```

## Skeleton output ##

It generates a basic skeleton with help and getopts

```bash
#!/bin/sh

help(){
cat <

arguments:

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
```