#Steps to create shell script
- Create folder for your shell scripts like
~/.bin
- Create script file
~/.bin/script
- Chmod it
chmod +x ~/.bin/script
##Conditionals:
if [ $1 ]
then
# do stuff
else
# show help
fi
##Functions
function help () {
echo "jazz - A simple script that makes using the Jasmine testing framework in a standalone project a little simpler."
echo "
echo " jazz init - include jasmine in the project";
echo " jazz create FunctionName - creates ./src/FunctionName.js ./spec/FunctionNameSpec.js";
echo " jazz run - runs tests in browser";
}
##Case
case "$1" in
init)
;;
create)
;;
run)
;;
*)
help
;;
esac
##Arrays
//Appending to arrays without reference:
ARRAY=()
ARRAY+=('foo')
ARRAY+=('bar')