[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: bash exit command should be unconditional

From: Eric Blake
Subject: Re: bash exit command should be unconditional
Date: Thu, 08 Apr 2010 07:19:28 -0600
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv: Gecko/20100330 Fedora/3.0.4-1.fc12 Lightning/1.0b1 Thunderbird/3.0.4

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 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 installs bash as
>> the standard shell :
>> $ ls -l /bin/sh
>> lrwxrwxrwx 1 root root 4 Jul  7  2009 /bin/sh -> bash
>> Now, because of the feature in question, scripts that utilize standard
>> /bin/sh don't work properly.

That just means that their scripts are not POSIX compliant.  They are
making assumptions (such as exit in a pipeline operating in the current
environment) that are not supported by POSIX.  It does not mean that
bash has to change behavior.  Unfortunately, it could also mean fixing a
lot of broken scripts.

Eric Blake   address@hidden    +1-801-349-2682
Libvirt virtualization library http://libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature

reply via email to

[Prev in Thread] Current Thread [Next in Thread]