Skip to content
This repository has been archived by the owner on Apr 26, 2024. It is now read-only.

Add note about is_int portability. #14

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

periish
Copy link

@periish periish commented May 15, 2020

No description provided.

@spiralofhope
Copy link

spiralofhope commented May 15, 2020

Unless I misunderstood:

Reproduced in zsh 5.7.1-1 under a Debian 10.1.0-amd64 install, (though updated recently).

Running that script with a header of #!/usr/bin/env sh and using the script ./script.sh 1 produces no output.

@neeasade
Copy link

I was able to reproduce.

@spiralofhope is you sh not symlinked to zsh? Here is how I reproduced:

$ echo 'printf %d "$1" >/dev/null 2>&1' >test.sh
$ sh ./test.sh not_number
! # <-- correct exit code
$ ln -s $(which zsh) ./sh
$ ./sh ./test.sh "not_number"
$ # exit code of 0

@spiralofhope
Copy link

You noted an exit code of !, did you mean 1 ?

My sh is symlinked to dash 0.5.10.2-5

echo 'printf %d "$1" >/dev/null 2>&1' >test.sh
# Actually dash:
sh ./test.sh not_number ; echo $?
1
ln -s $(which zsh) ./sh
./sh ./test.sh "not_number"; echo $?
0

At no point in my tests does the printf display anything.

@neeasade
Copy link

oh yeah my bad - the error I was trying to highlight was the exit code, I don't print anything either, of course.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants