Sfoglia il codice sorgente

function return examples

George Jones 1 anno fa
parent
commit
22720f90bb
1 ha cambiato i file con 6 aggiunte e 0 eliminazioni
  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