using set +o posix unsets POSIXLY_CORRECT, even when POSIXLY_CORRECT is a read only variable

2016-01-01 Thread nerdopolis
I tested on
4.2.45(1)-release

basically I have tested 
nerdopolis@nerdopolis:~$ readonly POSIXLY_CORRECT=1
nerdopolis@nerdopolis:~$ set +o posix
nerdopolis@nerdopolis:~$ echo $POSIXLY_CORRECT

nerdopolis@nerdopolis:~$

Although I will admit I'm not sure if it's supposed to do that or not



Re: using set +o posix unsets POSIXLY_CORRECT, even when POSIXLY_CORRECT is a read only variable

2016-01-01 Thread Cuong Manh Le
readonly var=value prevent shell scripter changing value of variable var,
there is no restriction for the shell itself.

Try:


set -o posix
readonly | grep SHELLOPTS


and:


set +o posix
readonly | grep SHELLOPTS


to see the missing of `posix` in 2nd command, the readonly variable
SHELLOPTS was changed by the shell.

On Fri, Jan 1, 2016 at 7:04 AM, nerdopolis 
wrote:

> I tested on
> 4.2.45(1)-release
>
> basically I have tested
> nerdopolis@nerdopolis:~$ readonly POSIXLY_CORRECT=1
> nerdopolis@nerdopolis:~$ set +o posix
> nerdopolis@nerdopolis:~$ echo $POSIXLY_CORRECT
>
> nerdopolis@nerdopolis:~$
>
> Although I will admit I'm not sure if it's supposed to do that or not
>
>


autocd doesn't invoke customized `cd` wrapper

2016-01-01 Thread transl8czech
Configuration Information [Automatically generated, do not change]:
Machine: x86_64
OS: linux-gnu
Compiler: gcc
Compilation CFLAGS:  -DPROGRAM='bash' -DCONF_HOSTTYPE='x86_64' 
-DCONF_OSTYPE='linux-gnu' -DCONF_MACHTYPE='x86_64-pc-linux-gnu' 
-DCONF_VENDOR='pc' -DLOCALEDIR='/usr/share/locale' -DPACKAGE='bash' -DSHELL 
-DHAVE_CONFIG_H   -I.  -I../. -I.././include -I.././lib  -D_FORTIFY_SOURCE=2 -g 
-O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat 
-Werror=format-security -Wall
uname output: Linux laptop 3.13.0-24-generic #47-Ubuntu SMP Fri May 2 23:30:00 
UTC 2014 x86_64 x86_64 x86_64 GNU/Linux
Machine Type: x86_64-pc-linux-gnu

Bash Version: 4.3
Patch Level: 11
Release Status: release

Description:
  If `cd` is a function or an alias in my environment, I think autocd ought to 
invoke
  that instead of the raw `command cd` (like it does now).

  Personally, I keep a stack of recent directories and I record frequences of 
the directories I'm
  in in my `cd` wrapper, and it'd be nice if autocd didn't circumvent the 
wrapper.

Repeat-By:

  Steps to reproduce:
$ cd(){ echo cding; command cd "$@"; }
$ shopt -s autocd
$ /etc
  cd /etc
# cd /var
  cding

Fix:
[Description of how to fix the problem.  If you don't know a
fix for the problem, don't include this section.]