bug-bash
[Top][All Lists]
Advanced

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

Re: Bogus value of variable BASH


From: Chet Ramey
Subject: Re: Bogus value of variable BASH
Date: Tue, 9 Feb 2016 07:44:54 -0500
User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.10; rv:38.0) Gecko/20100101 Thunderbird/38.5.1

On 2/8/16 7:09 PM, David Hunt wrote:

> Bash Version: 4.3
> Patch Level: 11
> Release Status: release
> 
> Description:
>       On my notebook running Ubuntu 14.04.3 LTS /bin/sh points to dash, not 
> bash.
>       To get sh behaviour from bash I use the command `exec -a sh /bin/bash'.
>       When I do so bash sets BASH to /bin/sh, which it demonstrably is not.

Bash sets the BASH variable from $0.  If $0 is a full pathname, it's used
directly, otherwise it's looked up in $PATH.  That algorithm is not
foolproof, and one way to fool it is to disguise the program name.

-- 
``The lyf so short, the craft so long to lerne.'' - Chaucer
                 ``Ars longa, vita brevis'' - Hippocrates
Chet Ramey, ITS, CWRU    chet@case.edu    http://cnswww.cns.cwru.edu/~chet/



reply via email to

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