fork download
  1. #!/bin/bash
  2.  
  3. variable=$(
  4. echo "moo"
  5. nosuchcommand || echo "this did not work out so well"
  6. nosuchcommand_either
  7. ls -l /usr/share/words >&2
  8. echo "*** bar ***")
  9.  
  10. echo "$variable"
  11.  
Success #stdin #stdout #stderr 0s 5028KB
stdin
Standard input is empty
stdout
moo
this did not work out so well
*** bar ***
stderr
./prog.sh: line 10: nosuchcommand: command not found
./prog.sh: line 11: nosuchcommand_either: command not found
ls: cannot access /usr/share/words: No such file or directory