For part one, you use the Lickety Script application to generate your script.
Use the menu to get there.
This is the command that will you want to execute on the command line. e.g. my-script.sh. This example script is executed with add-two-numbers.sh. So the name is add-two-numbers.
The script in this example has two args: num-one and num-two.
Click the add button to create a new argument.
Change the name to num-one. Add short name as -o and relevant help text. Toggle the validation to required.
Click the add button to create a new argument and enter details as before but for num-two. Short name as t, help text, and toggle validation to required.
This will download aa zip file with script framework. This zip file will contain everything you need to install and run your script -- minus your custom code that you haven't written yet
On Linux/Mac you can run 'unzip -l add-two-numbers.zip' to show you the contents. If yours looks like this, part one is complete. Move to part two. If it doesn't then something is broken and let me know about it on twitter
Once you have the zip file, you can install it on your computer.
Run the following commands.
The installer puts the files in various subdirectories in $HOME/.lickety-script.
Update your $HOME/.bash_profile to include the following lines.
Reload your shell or run 'source $HOME/.bash_profile'
Run 'add-two-numbers.sh -h'
Test run with arguments.
Run with arguments set and in verbose mode: 'add-two-numbers.sh -v --num-one 5 --num-two 3'
Go to script's directory in the Lickety Script home directory in : 'cd $HOME/.lickety-script/scripts/add-two-numbers'
Edit the main script file and add your implementation. In this example we're adding two numbers together and we'll use the Linux command 'bc'.
Edit the file with vi or your favorite text editor. 'vi add-two-numbers.sh'
Add the line 'bc "$NUM_DASH_ONE_ARG + $NUM_DASH_TWO_ARG"' at the bottom of the add-two-numbers.sh file. Save the file.
Give it a test run with 'add-two-numbers.sh -o 6 -t 3' and see the result.
You can see how Lickety Script takes care of all the parsing, validation, and help menu creation. It leaves you with the task of the script's implementation.
Now you can start experimenting and building your own scripts much faster and easier than before.
If you run into any issues or have any questions, please let me know on one of the various channels.