Example:
check_prog hostname.com /bin/check_awesome -c 10 -w 13
check_remote -H $HOSTNAME -C "$ARGS"
#To be expanded as
check_remote -H hostname.com -C "/bin/check_awesome -c 10 -w 13"
I hope the above makes sense. The arguments will change as I will be using this for about 20+ commands. Its a odd method of wrapping a program, but it’s to work around a few issues with a few systems we are using here (gotta love code from the 70s).
The above could be written in Perl or Python, but Bash would be the preferred method.
You can use shift
shift is a shell builtin that operates on the positional parameters. Each time you invoke shift, it “shifts” all the positional parameters down by one. $2 becomes $1, $3 becomes $2, $4 becomes $3, and so on
example: