Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.unix.shell > #22499
| From | Martijn Dekker <martijn@inlv.demon.nl> |
|---|---|
| Newsgroups | comp.unix.shell |
| Subject | Re: [ANN] KornShell 93u+m 1.0.0-beta.2 |
| Date | 2021-12-17 19:58 +0000 |
| Message-ID | <j248ebFrq7uU1@mid.individual.net> (permalink) |
| References | <j22f1cFh5m2U1@mid.individual.net> <sphijs$ejq$1@dont-email.me> <j236fkFldviU1@mid.individual.net> <JGDDG6C28aBHRfrQ6@bongo-ra.co> |
Op 17-12-21 om 12:50 schreef Spiros Bousbouras:
> On Fri, 17 Dec 2021 11:18:26 +0100
> Martijn Dekker <martijn@inlv.demon.nl> wrote:
>> What the announcement item above means instead is this:
>>
>> $ myfunc() { return 12345; }
>> $ myfunc; echo $?
>> 12345
>> $ (myfunc); echo $?
>> 57
>> $ ksh -c 'myfunc() { return 12345; }; myfunc'; echo $?
>> 57
>>
>> i.e., the exit status of a subshell or child shell that invokes
>> 'myfunc', and does nothing to overwrite $? before exiting, is the least
>> significant 8 bits of 12345, i.e., 12345 % 0xFF == 210.
>
> For the least significant 8 bits of 12345 the calculation you want is
> 12345 % 256 == 57 .Regardless , 12345 % 0xFF == 105 .
Indeed. Sorry. I was travelling and insufficiently caffeinated while
writing that. What I *meant* was: 12345 & 0xFF == 57
--
|| modernish -- harness the shell
|| https://github.com/modernish/modernish
||
|| KornShell lives!
|| https://github.com/ksh93/ksh
Back to comp.unix.shell | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
[ANN] KornShell 93u+m 1.0.0-beta.2 Martijn Dekker <martijn@inlv.demon.nl> - 2021-12-17 04:38 +0100
Re: [ANN] KornShell 93u+m 1.0.0-beta.2 Janis Papanagnou <janis_papanagnou@hotmail.com> - 2021-12-17 09:43 +0100
Re: [ANN] KornShell 93u+m 1.0.0-beta.2 Martijn Dekker <martijn@inlv.demon.nl> - 2021-12-17 11:18 +0100
Re: [ANN] KornShell 93u+m 1.0.0-beta.2 Spiros Bousbouras <spibou@gmail.com> - 2021-12-17 12:50 +0000
Arithmetic trivia (Was: [ANN] KornShell 93u+m 1.0.0-beta.2) gazelle@shell.xmission.com (Kenny McCormack) - 2021-12-17 13:10 +0000
Re: Arithmetic trivia (Was: [ANN] KornShell 93u+m 1.0.0-beta.2) Janis Papanagnou <janis_papanagnou@hotmail.com> - 2021-12-17 21:39 +0100
Re: [ANN] KornShell 93u+m 1.0.0-beta.2 Martijn Dekker <martijn@inlv.demon.nl> - 2021-12-17 19:58 +0000
Re: [ANN] KornShell 93u+m 1.0.0-beta.2 Janis Papanagnou <janis_papanagnou@hotmail.com> - 2021-12-18 15:07 +0100
Re: [ANN] KornShell 93u+m 1.0.0-beta.2 Martijn Dekker <martijn@inlv.demon.nl> - 2021-12-19 21:00 +0000
Re: [ANN] KornShell 93u+m 1.0.0-beta.2 Martijn Dekker <martijn@inlv.demon.nl> - 2021-12-21 19:12 +0000
Re: [ANN] KornShell 93u+m 1.0.0-beta.2 Janis Papanagnou <janis_papanagnou@hotmail.com> - 2021-12-24 14:46 +0100
csiph-web