Produces this output:
$ sh check_power_test.sh + echo begin begin + check_power 0 + exit 0 + return 0 + check_power 1 + exit 1 + [ 1 -ne 1 ] + return 1 + echo ignore ignore + check_power 255 + exit 255 + [ 255 -ne 1 ] + return 0 + echo end end
Produces this output:
$ sh check_power_test.sh
+ echo begin
begin
+ check_power 0
+ exit 0
+ return 0
+ check_power 1
+ exit 1
+ [ 1 -ne 1 ]
+ return 1
+ echo ignore
ignore
+ check_power 255
+ exit 255
+ [ 255 -ne 1 ]
+ return 0
+ echo end
end