resolution tests cd_bindir, cd_home, et b_env sauf une vraie erreur
This commit is contained in:
@@ -10,6 +10,191 @@ cat Makefile | grep pr | head -n 5 | hello (NA)
|
||||
echo $?
|
||||
|
||||
|
||||
#---------------------------------------------
|
||||
# export PWD et OLDPWD ne dependent pas des meme action que bash
|
||||
# (dans bash : cd ne creer pas PWD, et OLDPWD n'existe que si PWD existe)
|
||||
|
||||
unset PWD
|
||||
cd ..
|
||||
env | grep PWD
|
||||
|
||||
unset OLDPWD
|
||||
cd ..
|
||||
env | grep OLDPWD
|
||||
|
||||
unset PWD
|
||||
cd ..
|
||||
export PWD=new_value
|
||||
env | grep PWD
|
||||
|
||||
|
||||
unset PWD
|
||||
cd ..
|
||||
export PWD
|
||||
env | grep PWD
|
||||
|
||||
|
||||
#---------------------------------------------
|
||||
# export ne reconnait pas +=
|
||||
|
||||
export APPEND=1
|
||||
export APPEND+=2
|
||||
env | grep APPEND
|
||||
|
||||
|
||||
#---------------------------------------------
|
||||
# export seul n'affiche pas les variables d'env
|
||||
|
||||
export | grep -v -E '^declare -x _='
|
||||
env
|
||||
|
||||
export 1 _+ _OK _2? _OK2=VAR =NG OK3=
|
||||
export | grep -v -E '^declare -x _='
|
||||
env
|
||||
|
||||
export dquote='"' dollar='$' backslash='\' backquote='`' newline='\n'
|
||||
export | grep -v -E '^declare -x _='
|
||||
env
|
||||
|
||||
export APPEND=1
|
||||
export APPEND+=2
|
||||
export | grep APPEND
|
||||
env
|
||||
|
||||
export APPEND_NONE=1
|
||||
export APPEND_NONE+=
|
||||
export | grep APPEND_NONE
|
||||
env
|
||||
|
||||
export APPEND_NONE=
|
||||
export APPEND_NONE=
|
||||
export APPEND_NONE+=
|
||||
export | grep APPEND_NONE
|
||||
env
|
||||
|
||||
export APPEND_EMPTY=""
|
||||
export APPEND_EMPTY=""
|
||||
export APPEND_EMPTY=""
|
||||
export | grep APPEND_EMPTY
|
||||
env
|
||||
|
||||
export OVERWRITE=42
|
||||
export OVERWRITE=a
|
||||
export | grep OVERWRITE
|
||||
env
|
||||
|
||||
export A=B=C=D
|
||||
export | grep A
|
||||
env
|
||||
|
||||
export PATH
|
||||
export | grep PATH
|
||||
env
|
||||
|
||||
export PWD
|
||||
export | grep PWD
|
||||
env
|
||||
|
||||
export OLDPWD
|
||||
export | grep OLDPWD
|
||||
env
|
||||
|
||||
unset PWD
|
||||
cd ..
|
||||
export | grep PWD
|
||||
env
|
||||
|
||||
unset OLDPWD
|
||||
cd ..
|
||||
export | grep OLDPWD
|
||||
env
|
||||
|
||||
unset PWD
|
||||
cd ..
|
||||
export PWD=new_value
|
||||
export | grep PWD
|
||||
env
|
||||
|
||||
unset OLDPWD
|
||||
cd ..
|
||||
export OLDPWD=new_value
|
||||
export | grep OLDPWD
|
||||
env
|
||||
|
||||
unset PWD
|
||||
cd ..
|
||||
export PWD
|
||||
export | grep PWD
|
||||
env
|
||||
|
||||
unset OLDPWD
|
||||
cd ..
|
||||
export OLDPWD
|
||||
export | grep OLDPWD
|
||||
env
|
||||
|
||||
#---------------------------------------------
|
||||
# cd /bin redirects to /usr/bin
|
||||
|
||||
cd /bin
|
||||
pwd
|
||||
|
||||
cd /bin/../
|
||||
pwd
|
||||
|
||||
cd /
|
||||
pwd
|
||||
cd /bin
|
||||
pwd
|
||||
|
||||
cd /
|
||||
pwd
|
||||
cd //bin
|
||||
pwd
|
||||
|
||||
cd //
|
||||
pwd
|
||||
cd //bin
|
||||
pwd
|
||||
|
||||
cd ///
|
||||
pwd
|
||||
cd ///bin
|
||||
pwd
|
||||
|
||||
cd ////
|
||||
pwd
|
||||
cd ////bin
|
||||
pwd
|
||||
|
||||
cd /////
|
||||
pwd
|
||||
cd /////bin
|
||||
pwd
|
||||
|
||||
cd //////
|
||||
pwd
|
||||
cd //////bin
|
||||
pwd
|
||||
|
||||
cd ///////
|
||||
pwd
|
||||
cd ///////bin
|
||||
pwd
|
||||
|
||||
|
||||
#---------------------------------------------
|
||||
# https://stackoverflow.com/questions/20690828/what-does-double-slash-in-cd-mean-in-linux
|
||||
# pathname with two slashes
|
||||
|
||||
export HOME=//
|
||||
cd
|
||||
pwd
|
||||
|
||||
export HOME=//bin/..////////////bin/../
|
||||
cd
|
||||
pwd
|
||||
|
||||
#---------------------------------------------
|
||||
# Race condition, unpredictable behaviour
|
||||
|
||||
|
||||
Reference in New Issue
Block a user