Browse Source

exit subshell with status

master
Anthony Fadly 1 year ago
parent
commit
485ee0c69d
1 changed files with 2 additions and 0 deletions
  1. 2
    0
      sep19-more-commands.md

+ 2
- 0
sep19-more-commands.md View File

@@ -55,4 +55,6 @@ $ cmd1 && cmd2 # do cmd1, if cmd1 worked, do cmd2
$ cd /tmp && { ls; exit 0; }

$ cd /tmp && ( ls; exit 0 ) # run ls and exit in subshell

( ls; exit $? ) # exit subshell the same exit status of ls
```

Loading…
Cancel
Save