example-script/example.sh

25 lines
294 B
Bash
Executable File

#! /bin/bash
case "$@" in *--opt-1*|*-h*)
echo OPT_1
exit 0;
esac
case "$@" in *--opt-2*)
OPT_2=true
esac
if [ $OPT_2 ]
then echo $OPT_2
fi
case "$@" in *--opt-3*)
echo OPT_3
opti_3=avoid
esac
if [ $opti_3 = avoid ]
then echo opti_3 was avoided
else echo opti_3 was automated
fi