bug-bash
[Top][All Lists]
Advanced

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

Re: Environment variable "PS4" can not be passed to bash script from ver


From: Chet Ramey
Subject: Re: Environment variable "PS4" can not be passed to bash script from version 4.2.46(2)
Date: Tue, 23 Oct 2018 16:47:48 -0400
User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.13; rv:52.0) Gecko/20100101 Thunderbird/52.9.1

On 10/23/18 12:06 PM, Greg Wooledge wrote:
> On Tue, Oct 23, 2018 at 03:20:12PM +0000, Chen, Farrah wrote:
>> But in Bash script, it cannot work, it keeps its original value:
>> [root@fchen ~]# cat test.sh
>> #!/usr/bin/bash
>> echo $PS4
>> echo $FAN
> 
> This is because you're doing it as root.  Bash strips PS4 from the
> environment when started as root, as a security precaution.

That change came in in bash-4.3 (patch 48). His vendor probably patched
their version of bash-4.2 to do the same thing.

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



reply via email to

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