This is a small script that takes a bash command and decodes the parameters in non sequential order except definers.
#!/bin/bash
if [ "$#" -ne 1 ] || ! [ -d "$1" ]; then
echo "Usage: $0 " >&2
exit 1
fi
while [[ $# > 1 ]]
do
key=”$1″
echo $key
shift
case $key in
-c|–color|color)
COLOR=$1
shift
;;
-s|–section|section)
SECTION=”yes”
;;
*)
;;
esac
done
nJoy 😉
