Browse Source

function return examples

George Jones 1 year ago
parent
commit
22720f90bb
1 changed files with 6 additions and 0 deletions
  1. 6 0
      home/public/snippits/bash/functions-as-subshells.sh

+ 6 - 0
home/public/snippits/bash/functions-as-subshells.sh

@@ -31,3 +31,9 @@ if retval=`f BAR`; then
 else
     echo f with an argument failed
 fi
+
+if f BAR; then
+    echo f with an argument succeeded, ignoring retval
+else
+    echo f with an argument failed
+fi