Re: GNU Bash v.4.4.23-5 built-in function 'set' produces variable outputs

2018-10-23 Thread Robert Elz
ps: I did not suggest that $_ should go away, I know that's not going to happen ... just that it would be nice for those who really don't want it to be able to turn it off. kre

Re: GNU Bash v.4.4.23-5 built-in function 'set' produces variable outputs

2018-10-23 Thread Robert Elz
Date:Mon, 22 Oct 2018 09:37:19 -0400 From:Greg Wooledge Message-ID: <20181022133719.g4wc7uuowwfff...@eeg.ccf.org> | I occasionally run a command like mkdir /tmp/x && cd "$_" cdnd() { mkdir -p "$1" && cd "$1" } Make it as fancy as you want.

Re: GNU Bash v.4.4.23-5 built-in function 'set' produces variable outputs

2018-10-23 Thread Greg Wooledge
On Tue, Oct 23, 2018 at 02:06:37PM +0700, Robert Elz wrote: > Interactively you're much more > likely to want !$ than $_ (I'd suggest infinitely more lijkely...) You mean negative infinity. wooledg:~$ grep histexpand .bashrc set +o histexpand

Environment variable "PS4" can not be passed to bash script from version 4.2.46(2)

2018-10-23 Thread Chen, Farrah
Hello, I found a strange phenomenon, just as the subject, environment variable "PS4" cannot be passed to bash script, but any other variable, even self-defined variable can be passed to bash script. My bash version is "GNU bash, version 4.2.46(2)-release (x86_64-redhat-linux-gnu)", I

Re: Environment variable "PS4" can not be passed to bash script from version 4.2.46(2)

2018-10-23 Thread Greg Wooledge
On Tue, Oct 23, 2018 at 03:20:12PM +, 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

Re: Environment variable "PS4" can not be passed to bash script from version 4.2.46(2)

2018-10-23 Thread Chet Ramey
On 10/23/18 12:06 PM, Greg Wooledge wrote: > On Tue, Oct 23, 2018 at 03:20:12PM +, 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.

Re: GNU Bash v.4.4.23-5 built-in function 'set' produces variable outputs

2018-10-23 Thread Bob Proulx
Robert Elz wrote: > ps: I did not suggest that $_ should go away, I know that's not going to > happen ... just that it would be nice for those who really don't want it to > be able to turn it off. I'm having a hard time understanding why one would want to turn off this feature. It isn't

RE: Environment variable "PS4" can not be passed to bash script from version 4.2.46(2)

2018-10-23 Thread Chen, Farrah
Got it, thanks for the info. Thanks, Fan -Original Message- From: Chet Ramey [mailto:chet.ra...@case.edu] Sent: Wednesday, October 24, 2018 4:48 AM To: Chen, Farrah ; bug-bash@gnu.org Cc: chet.ra...@case.edu Subject: Re: Environment variable "PS4" can not be passed to bash script