From Bugzilla Helper: User-Agent: Mozilla/4.73 [en] (X11; U; Linux 2.0.34 i686) Description of problem: A function in a shell script returns a value larger than 256. After returning, $? is 1 instead of 256. When returning a value less than or equal to 256, $? is the correct value. How reproducible: Always Steps to Reproduce: 1. Run the following shell script. #!/bin/sh foo() { i=257 return $i } foo echo "foo returned $?" Actual Results: The script outputs: foo returned 1 Expected Results: The script should output: foo returned 257 Additional info:
This is normal behavior. Since the return value of an application is a byte (unsigned char), 256 = 0, 257 = 1, ...