ใช่. ตัวอย่างเช่น:
$ exitwith() { return $1; }
$ for stat in {0..10}; do
> if exitwith $stat; then
> echo "An exit status of $stat is considered true"
> else
> echo "An exit status of $stat is considered false"
> fi
> done
An exit status of 0 is considered true
An exit status of 1 is considered false
An exit status of 2 is considered false
An exit status of 3 is considered false
An exit status of 4 is considered false
An exit status of 5 is considered false
An exit status of 6 is considered false
An exit status of 7 is considered false
An exit status of 8 is considered false
An exit status of 9 is considered false
An exit status of 10 is considered false
แต่จริงๆแล้วมันซับซ้อนกว่านั้นเล็กน้อยเนื่องจากสถานะทางออกเป็นจำนวนเต็มแบบไม่ได้ลงนาม 8 บิตจะสามารถอยู่ในช่วงตั้งแต่ 0 ถึง 255 เท่านั้น ค่านอกช่วงนั้นจะลดโมดูโล 256 ลงในช่วงนั้น:
$ for stat in -2 -1 255 256 257; do
> if exitwith $stat; then
> echo "An exit status of $stat (actually $?) is considered true"
> else
> echo "An exit status of $stat (actually $?) is considered false"
> fi
> done
An exit status of -2 (actually 254) is considered false
An exit status of -1 (actually 255) is considered false
An exit status of 255 (actually 255) is considered false
An exit status of 256 (actually 0) is considered true
An exit status of 257 (actually 1) is considered false