diff --git a/test.sh b/test.sh index d0010a6..e663cb7 100755 --- a/test.sh +++ b/test.sh @@ -18,19 +18,12 @@ fi -function myfunc() -{ - local -n __resultvar="$1" || return 1 - __resultvar[0]="a" - __resultvar[1]="b" - echo 'yes'; - if [ -f /etc/debian_version ] ; then - __resultvar[2]="c" - __resultvar[3]="d" - __resultvar[4]="e" - fi - echo "ok" -} - -if [ "${(detect_os OS)[1]}" = "debian" ]; then echo 'YES'; fi +while getopts 'r' flag; do + case "${flag}" in + r) echo "R" ;; + a) echo "A" ;; + b) echo "B" ;; + c) echo "C" ;; + esac +done