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
- Host: GitHub
- URL: https://github.com/kakwa/mk-sh-skel
- Owner: kakwa
- License: other
- Created: 2013-02-01T08:37:57.000Z (over 13 years ago)
- Default Branch: master
- Last Pushed: 2015-11-26T23:25:02.000Z (over 10 years ago)
- Last Synced: 2025-05-29T23:39:51.971Z (about 1 year ago)
- Topics: boilerplate-template, shell, skeleton
- Language: Shell
- Size: 36.1 KB
- Stars: 1
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
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
```