Welcome to mirror list, hosted at ThFree Co, Russian Federation.

falsetick.tests « ash-psubst « ash_test « shell - git.busybox.net/busybox.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: d2b93695ec021bb2af9febc4b7a22debf9ad239a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
# Exitcode 0 (`` has no exitcode, but assignment has):
true;  a=``; echo $?
false; a=``; echo $?
true;  a=$(); echo $?
false; a=$(); echo $?
# Exitcode 2 (`cmd` expansion sets exitcode after assignment set it to 0):
true;  a=`exit 2`; echo $?
false; a=`exit 2`; echo $?
true;  a=$(exit 2); echo $?
false; a=$(exit 2); echo $?
# Exitcode 1 (redirect sets exitcode to 1 on error after them):
true;  a=`` >/does/not/exist; echo $?
false; a=`` >/does/not/exist; echo $?
true;  a=$() >/does/not/exist; echo $?
false; a=$() >/does/not/exist; echo $?
true;  a=`exit 2` >/does/not/exist; echo $?
false; a=`exit 2` >/does/not/exist; echo $?
true;  a=$(exit 2) >/does/not/exist; echo $?
false; a=$(exit 2) >/does/not/exist; echo $?