* Re: different behaviour of bash and sh
@ 2001-03-12 2:44 Chet Ramey
0 siblings, 0 replies; 8+ messages in thread
From: Chet Ramey @ 2001-03-12 2:44 UTC (permalink / raw)
To: ralf; +Cc: bug-bash, cygwin, chet
> Machine Type: i686-pc-cygwin
>
> Bash Version: 2.04
> Patch Level: 7
> Release Status: release
>
> Description:
> The following script behaves differently in bash and sh:
>
> % cat script
> #!/bin/sh --
> checkstat() {
> echo $?
> }
> false
> checkstat
> # End of file
>
> Repeat-By:
>
> $ type bash
> bash is /usr/bin/bash
> $ bash script
> 1
> $ type sh
> sh is /usr/bin/sh
> $ sh script
> 0
>
> The 0 is wrong IMHO, it should be 1. (Even HP with their BD-/bin/sh
> returns 1).
You're reporting a bug in the cygwin sh, not bash.
--
``The lyf so short, the craft so long to lerne.'' - Chaucer
( ``Discere est Dolere'' -- chet)
Chet Ramey, CWRU chet@po.CWRU.Edu http://cnswww.cns.cwru.edu/~chet/
--
Want to unsubscribe from this list?
Check out: http://cygwin.com/ml/#unsubscribe-simple
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: different behaviour of bash and sh
2001-03-09 6:36 ` Andrej Borsenkow
@ 2001-03-09 6:46 ` Ralf Fassel
0 siblings, 0 replies; 8+ messages in thread
From: Ralf Fassel @ 2001-03-09 6:46 UTC (permalink / raw)
To: Andrej Borsenkow; +Cc: cygwin
* Andrej Borsenkow
| So what? The question is, if the exibited behaviour of *sh* is
| correct; the question was not "if sh is bash".
Earnie wanted to point out that my report was inappropriate at the
bash-bug mailinglist (which I had included since on my Linux systems
/bin/sh is a link to /bin/bash, so I just assumed the two being
identical on Cygwin too, which is not the case end of long sentence)
| IMHO that is a bug in sh (or ash if you insist). The 'echo $?' is
| the next command executed after 'false' - so , there is nothing that
| can change the value of '$?' in between.
For completeness sake: On my SUSE 7.1 System, `ash', `sh' and `bash'
all echo `1', so I think this is really a problem in the cygwin port
of `ash' which gets installed as /bin/sh.
I just had a quick glance at the ash source, but I'm in for the
weekend now, so no patches :-)
R'
--
Want to unsubscribe from this list?
Check out: http://cygwin.com/ml/#unsubscribe-simple
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: different behaviour of bash and sh
2001-03-09 4:42 ` Earnie Boyd
2001-03-09 4:57 ` Ralf Fassel
@ 2001-03-09 6:36 ` Andrej Borsenkow
2001-03-09 6:46 ` Ralf Fassel
1 sibling, 1 reply; 8+ messages in thread
From: Andrej Borsenkow @ 2001-03-09 6:36 UTC (permalink / raw)
To: cygwin; +Cc: Ralf Fassel, bug-bash
On Fri, 9 Mar 2001, Earnie Boyd wrote:
> In the Cygwin release
>
> sh != bash
> sh == ash
>
So what? The question is, if the exibited behaviour of *sh* is correct;
the question was not "if sh is bash".
IMHO that is a bug in sh (or ash if you insist). The 'echo $?' is the next
command executed after 'false' - so , there is nothing that can change the
value of '$?' in between.
-andrej
> Earnie.
>
> Ralf Fassel wrote:
> >
> > Configuration Information [Automatically generated, do not change]:
> > Machine: i686
> > OS: cygwin
> > Compiler: gcc
> > Compilation CFLAGS: -DPROGRAM='bash.exe' -DCONF_HOSTTYPE='i686' -DCONF_OSTYPE='cygwin' -DCONF_MACHTYPE='i686-pc-cygwin' -DCONF_VENDOR='pc' -DSHELL -DHAVE_CONFIG_H -I. -I../src -I../src/include -I../src/lib -I/src/bash/distro/usr/include -g -O2
> > uname output: CYGWIN_NT-4.0 MARS 1.1.8(0.34/3/2) 2001-01-31 10:08 i686 unknown
> > Machine Type: i686-pc-cygwin
> >
> > Bash Version: 2.04
> > Patch Level: 7
> > Release Status: release
> >
> > Description:
> > The following script behaves differently in bash and sh:
> >
> > % cat script
> > #!/bin/sh --
> > checkstat() {
> > echo $?
> > }
> > false
> > checkstat
> > # End of file
> >
> > Repeat-By:
> >
> > $ type bash
> > bash is /usr/bin/bash
> > $ bash script
> > 1
> > $ type sh
> > sh is /usr/bin/sh
> > $ sh script
> > 0
> >
> > The 0 is wrong IMHO, it should be 1. (Even HP with their BD-/bin/sh
> > returns 1).
> >
> > R'
> >
> > --
> > Want to unsubscribe from this list?
> > Check out: http://cygwin.com/ml/#unsubscribe-simple
>
> _________________________________________________________
> Do You Yahoo!?
> Get your free @yahoo.com address at http://mail.yahoo.com
>
>
> --
> Want to unsubscribe from this list?
> Check out: http://cygwin.com/ml/#unsubscribe-simple
>
>
--
------------------------------------------------------------------------
Andrej Borsenkow Fax: +7 (095) 737 2747
Siemens ICP ITS Moscow Tel: +7 (095) 737 2723
E-Mail: Andrej.Borsenkow@mow.siemens.ru
-------------------------------------------------------------------------
--
Want to unsubscribe from this list?
Check out: http://cygwin.com/ml/#unsubscribe-simple
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: different behaviour of bash and sh
2001-03-09 5:20 ` Earnie Boyd
@ 2001-03-09 5:35 ` Ralf Fassel
0 siblings, 0 replies; 8+ messages in thread
From: Ralf Fassel @ 2001-03-09 5:35 UTC (permalink / raw)
To: Earnie Boyd
* Earnie Boyd
| I was pointing your fallacy especially to the bash-bugs list.
Ok, point taken. True, I wasn't aware that sh != bash in cygwin.
| If you feel that ash is incorrect then please, download the source,
| fix it, submit a patch to cygwin-apps@cygwin.com for consideration.
Business as usual :-)
R'
--
Want to unsubscribe from this list?
Check out: http://cygwin.com/ml/#unsubscribe-simple
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: different behaviour of bash and sh
2001-03-09 4:57 ` Ralf Fassel
@ 2001-03-09 5:20 ` Earnie Boyd
2001-03-09 5:35 ` Ralf Fassel
0 siblings, 1 reply; 8+ messages in thread
From: Earnie Boyd @ 2001-03-09 5:20 UTC (permalink / raw)
To: Ralf Fassel; +Cc: cygwin
Ralf Fassel wrote:
>
> * Earnie Boyd
> | In the Cygwin release
> |
> | sh != bash
> | sh == ash
>
> And `ash' is supposed to return 0 for $? of `false'?
>
I wasn't saying ash does or doesn't have a bug; I was pointing your
fallacy especially to the bash-bugs list. If you feel that ash is
incorrect then please, download the source, fix it, submit a patch to
cygwin-apps@cygwin.com for consideration.
Earnie.
_________________________________________________________
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com
--
Want to unsubscribe from this list?
Check out: http://cygwin.com/ml/#unsubscribe-simple
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: different behaviour of bash and sh
2001-03-09 4:42 ` Earnie Boyd
@ 2001-03-09 4:57 ` Ralf Fassel
2001-03-09 5:20 ` Earnie Boyd
2001-03-09 6:36 ` Andrej Borsenkow
1 sibling, 1 reply; 8+ messages in thread
From: Ralf Fassel @ 2001-03-09 4:57 UTC (permalink / raw)
To: cygwin
* Earnie Boyd
| In the Cygwin release
|
| sh != bash
| sh == ash
And `ash' is supposed to return 0 for $? of `false'?
R'
--
Want to unsubscribe from this list?
Check out: http://cygwin.com/ml/#unsubscribe-simple
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: different behaviour of bash and sh
2001-03-08 19:39 Ralf Fassel
@ 2001-03-09 4:42 ` Earnie Boyd
2001-03-09 4:57 ` Ralf Fassel
2001-03-09 6:36 ` Andrej Borsenkow
0 siblings, 2 replies; 8+ messages in thread
From: Earnie Boyd @ 2001-03-09 4:42 UTC (permalink / raw)
To: Ralf Fassel; +Cc: bug-bash, cygwin
In the Cygwin release
sh != bash
sh == ash
Earnie.
Ralf Fassel wrote:
>
> Configuration Information [Automatically generated, do not change]:
> Machine: i686
> OS: cygwin
> Compiler: gcc
> Compilation CFLAGS: -DPROGRAM='bash.exe' -DCONF_HOSTTYPE='i686' -DCONF_OSTYPE='cygwin' -DCONF_MACHTYPE='i686-pc-cygwin' -DCONF_VENDOR='pc' -DSHELL -DHAVE_CONFIG_H -I. -I../src -I../src/include -I../src/lib -I/src/bash/distro/usr/include -g -O2
> uname output: CYGWIN_NT-4.0 MARS 1.1.8(0.34/3/2) 2001-01-31 10:08 i686 unknown
> Machine Type: i686-pc-cygwin
>
> Bash Version: 2.04
> Patch Level: 7
> Release Status: release
>
> Description:
> The following script behaves differently in bash and sh:
>
> % cat script
> #!/bin/sh --
> checkstat() {
> echo $?
> }
> false
> checkstat
> # End of file
>
> Repeat-By:
>
> $ type bash
> bash is /usr/bin/bash
> $ bash script
> 1
> $ type sh
> sh is /usr/bin/sh
> $ sh script
> 0
>
> The 0 is wrong IMHO, it should be 1. (Even HP with their BD-/bin/sh
> returns 1).
>
> R'
>
> --
> Want to unsubscribe from this list?
> Check out: http://cygwin.com/ml/#unsubscribe-simple
_________________________________________________________
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com
--
Want to unsubscribe from this list?
Check out: http://cygwin.com/ml/#unsubscribe-simple
^ permalink raw reply [flat|nested] 8+ messages in thread
* different behaviour of bash and sh
@ 2001-03-08 19:39 Ralf Fassel
2001-03-09 4:42 ` Earnie Boyd
0 siblings, 1 reply; 8+ messages in thread
From: Ralf Fassel @ 2001-03-08 19:39 UTC (permalink / raw)
To: bug-bash, cygwin
Configuration Information [Automatically generated, do not change]:
Machine: i686
OS: cygwin
Compiler: gcc
Compilation CFLAGS: -DPROGRAM='bash.exe' -DCONF_HOSTTYPE='i686' -DCONF_OSTYPE='cygwin' -DCONF_MACHTYPE='i686-pc-cygwin' -DCONF_VENDOR='pc' -DSHELL -DHAVE_CONFIG_H -I. -I../src -I../src/include -I../src/lib -I/src/bash/distro/usr/include -g -O2
uname output: CYGWIN_NT-4.0 MARS 1.1.8(0.34/3/2) 2001-01-31 10:08 i686 unknown
Machine Type: i686-pc-cygwin
Bash Version: 2.04
Patch Level: 7
Release Status: release
Description:
The following script behaves differently in bash and sh:
% cat script
#!/bin/sh --
checkstat() {
echo $?
}
false
checkstat
# End of file
Repeat-By:
$ type bash
bash is /usr/bin/bash
$ bash script
1
$ type sh
sh is /usr/bin/sh
$ sh script
0
The 0 is wrong IMHO, it should be 1. (Even HP with their BD-/bin/sh
returns 1).
R'
--
Want to unsubscribe from this list?
Check out: http://cygwin.com/ml/#unsubscribe-simple
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2001-03-12 2:44 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-03-12 2:44 different behaviour of bash and sh Chet Ramey
-- strict thread matches above, loose matches on Subject: below --
2001-03-08 19:39 Ralf Fassel
2001-03-09 4:42 ` Earnie Boyd
2001-03-09 4:57 ` Ralf Fassel
2001-03-09 5:20 ` Earnie Boyd
2001-03-09 5:35 ` Ralf Fassel
2001-03-09 6:36 ` Andrej Borsenkow
2001-03-09 6:46 ` Ralf Fassel
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).