`pwd' returns a dot
$ cd / $ PWD=. bash -c pwd . $ PWD=. ksh -c pwd / Posix says that pwd shouldn't return the filenames dot or dot-dot. http://pubs.opengroup.org/onlinepubs/9699919799/utilities/pwd.html
RE: `pwd' returns a dot
When variable PWD changed, the behavior of pwd is unspecified http://pubs.opengroup.org/onlinepubs/9699919799/utilities/pwd.html#tag_20_97_08 -- Mr. LE Manh CuongMobile: +84 1216 181090Skype: manhcuongle> From: 446240...@qq.com > Subject: `pwd' returns a dot > Date: Wed, 16 Sep 2015 15:51:08 +0800 > To: bug-bash@gnu.org > > $ cd / > $ PWD=. bash -c pwd > . > $ PWD=. ksh -c pwd > / > > Posix says that pwd shouldn't return the filenames dot or dot-dot. > http://pubs.opengroup.org/onlinepubs/9699919799/utilities/pwd.html >
Re: `pwd' returns a dot
2015-09-16 15:51:08 +0800, ziyunfei: > $ cd / > $ PWD=. bash -c pwd > . > $ PWD=. ksh -c pwd > / > > Posix says that pwd shouldn't return the filenames dot or dot-dot. > http://pubs.opengroup.org/onlinepubs/9699919799/utilities/pwd.html Also: $ cd / $ PWD=bin/.. bash -c 'pwd; cd ..; pwd' bin/.. .. Note that POSIX is now explicit in how $PWD from the environment should be handled: http://pubs.opengroup.org/onlinepubs/9699919799/utilities/V3_chap02.html#tag_18_05_03 -- Stephane
Re: `pwd' returns a dot
On 9/16/15 3:51 AM, ziyunfei wrote: > $ cd / > $ PWD=. bash -c pwd > . > $ PWD=. ksh -c pwd > / > > Posix says that pwd shouldn't return the filenames dot or dot-dot. > http://pubs.opengroup.org/onlinepubs/9699919799/utilities/pwd.html Thanks for the report. I'll take a look. Chet -- ``The lyf so short, the craft so long to lerne.'' - Chaucer ``Ars longa, vita brevis'' - Hippocrates Chet Ramey, ITS, CWRUc...@case.eduhttp://cnswww.cns.cwru.edu/~chet/
SHLVL is a random string (uninitialized string in C) when its true value is "1000"
$ SHLVL=998 bash -c 'echo $SHLVL' 999 $ SHLVL=999 bash -c 'echo $SHLVL' $ SHLVL=999 bash -c 'echo -n "$SHLVL" | hexdump' 0b 01 $ SHLVL=999 bash -c 'echo -n "$SHLVL" | hexdump' 0f 01 $ SHLVL=999 bash -c 'echo -n "$SHLVL" | hexdump' 04 01 $ SHLVL=1000 bash -c 'echo $SHLVL' bash: warning: shell level (1001) too high, resetting to 1 1
null ptr deref & segfault in multiple versions of bash
<<$(()())|>_[$($(<<0)) triggers a null ptr deref and segfault in multiple versions of bash https://savannah.gnu.org/support/index.php?108884