Last change
on this file since 3571 was 3320, checked in by Bruno Cornec, 10 years ago |
- Re-add (thanks git BTW) the 2.2.9 branch which had been destroyed in
the move to 3.0
|
-
Property svn:executable
set to
*
|
File size:
843 bytes
|
Rev | Line | |
---|
[3320] | 1 | # Exitcode 0 (`` has no exitcode, but assignment has):
|
---|
| 2 | true; a=``; echo $?
|
---|
| 3 | false; a=``; echo $?
|
---|
| 4 | true; a=$(); echo $?
|
---|
| 5 | false; a=$(); echo $?
|
---|
| 6 | # Exitcode 2 (`cmd` expansion sets exitcode after assignment set it to 0):
|
---|
| 7 | true; a=`exit 2`; echo $?
|
---|
| 8 | false; a=`exit 2`; echo $?
|
---|
| 9 | true; a=$(exit 2); echo $?
|
---|
| 10 | false; a=$(exit 2); echo $?
|
---|
| 11 | # Exitcode 1 (redirect sets exitcode to 1 on error after them):
|
---|
| 12 | true; a=`` >/does/not/exist; echo $?
|
---|
| 13 | false; a=`` >/does/not/exist; echo $?
|
---|
| 14 | true; a=$() >/does/not/exist; echo $?
|
---|
| 15 | false; a=$() >/does/not/exist; echo $?
|
---|
| 16 | true; a=`exit 2` >/does/not/exist; echo $?
|
---|
| 17 | false; a=`exit 2` >/does/not/exist; echo $?
|
---|
| 18 | true; a=$(exit 2) >/does/not/exist; echo $?
|
---|
| 19 | false; a=$(exit 2) >/does/not/exist; echo $?
|
---|
| 20 | # ...and assignment still happens despite redirect error:
|
---|
| 21 | true; a=$(echo b) >/does/not/exist; echo $?
|
---|
| 22 | echo "Done: a=$a"
|
---|
Note:
See
TracBrowser
for help on using the repository browser.