Re: bash exit command should be unconditional

2010-04-08 Thread Bob Proulx
Greg Wooledge wrote: > Bob Proulx wrote: > > Greg Wooledge wrote: > > > Migrating FROM something that used Korn shell, I presume? Why not > > > just install Korn shell and use #!/bin/ksh on your scripts, if you need > > > to rely on Korn shell features? > > > When I read this I was torn about sug

Re: bash exit command should be unconditional

2010-04-08 Thread Greg Wooledge
On Thu, Apr 08, 2010 at 10:07:32AM -0600, Bob Proulx wrote: > Greg Wooledge wrote: > > Migrating FROM something that used Korn shell, I presume? Why not > > just install Korn shell and use #!/bin/ksh on your scripts, if you need > > to rely on Korn shell features? > When I read this I was torn ab

Re: bash exit command should be unconditional

2010-04-08 Thread Bob Proulx
Greg Wooledge wrote: > Vadym Chepkov wrote: > > A company I work for is trying to migrate their applications to > > Linux platform and have selected RedHat as the vendor. Redhat > > installs bash as the standard shell : > > > $ ls -l /bin/sh > > lrwxrwxrwx 1 root root 4 Jul 7 2009 /bin/sh -> bas

Re: bash exit command should be unconditional

2010-04-08 Thread Greg Wooledge
On Thu, Apr 08, 2010 at 06:05:05AM -0700, Vadym Chepkov wrote: > A company I work for is trying to migrate their applications to Linux > platform and have selected RedHat as the vendor. Redhat installs bash as the > standard shell : > $ ls -l /bin/sh > lrwxrwxrwx 1 root root 4 Jul 7 2009 /bin/sh

Re: bash exit command should be unconditional

2010-04-08 Thread Eric Blake
On 04/08/2010 07:11 AM, Matias A. Fonzo wrote: > If I am right when you invoke bash as "/bin/sh" (/bin/sh -> bash). Bash > runs in POSIX mode. Correct. But POSIX allows shells to decide whether or not commands in pipelines operate in the current shell or a subshell. > >> I certainly have chosen

Re: bash exit command should be unconditional

2010-04-08 Thread Matias A. Fonzo
If I am right when you invoke bash as "/bin/sh" (/bin/sh -> bash). Bash runs in POSIX mode. > I certainly have chosen the subject wrong, but I don't want to start a new > thread now. Please let me backpedal a bit and describe the problem I am > trying to solve. > > A company I work for is trying t

Re: bash exit command should be unconditional

2010-04-08 Thread Vadym Chepkov
I certainly have chosen the subject wrong, but I don't want to start a new thread now. Please let me backpedal a bit and describe the problem I am trying to solve. A company I work for is trying to migrate their applications to Linux platform and have selected RedHat as the vendor. Redhat insta

Re: bash exit command should be unconditional

2010-04-08 Thread Roman Rakus
On 04/08/2010 06:49 AM, Bob Proulx wrote: Vadym Chepkov wrote: I found out a very unusual feature of bash which makes it to act really unexpected. I understand that pipelines are executed in a separate subshell, but I really think 'exit' command should be absolute. Consider a trivial code:

Re: bash exit command should be unconditional

2010-04-07 Thread Bob Proulx
Vadym Chepkov wrote: > I found out a very unusual feature of bash which makes it to act > really unexpected. I understand that pipelines are executed in a > separate subshell, but I really think 'exit' command should be > absolute. Consider a trivial code: Note that dash also behaves this way too.

Re: bash exit command should be unconditional

2010-04-07 Thread Jan Schampera
Vadym Chepkov schrieb: > I would expect never see "Continue" printed The 'exit' command exits the subshell you just created. http://bash-hackers.org/wiki/doku.php/scripting/processtree There's also a FAQ about it, E4. Jan

bash exit command should be unconditional

2010-04-07 Thread Vadym Chepkov
Hi, I found out a very unusual feature of bash which makes it to act really unexpected. I understand that pipelines are executed in a separate subshell, but I really think 'exit' command should be absolute. Consider a trivial code: #!/bin/bash echo Start ps -ef | while read proc do echo $proc