Google finally let me down. I cannot find how to do this in Bourne shell scripts:
I am writing a shell script to handle all of my tests for a project. I created functions for each task that this script could perform (build, run, clean up, etc.), and I would like to pass any additional command line parameters (besides the command itself) to the desired function.
Example:
./test.sh build -j should pass -j to the build function.
The pseudocode version of this logic will look like this:
function build() { make $* } if [ $1 == 'build' ]; then build $2 -> $N fi
How can i do this?
chpatton013
source share