Explorar el Código

function return examples

George Jones hace 1 año
padre
commit
22720f90bb
Se han modificado 1 ficheros con 6 adiciones y 0 borrados
  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