resolution tests cd_bindir, cd_home, et b_env sauf une vraie erreur
This commit is contained in:
@@ -1,45 +0,0 @@
|
|||||||
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
|
|
||||||
@@ -3,14 +3,6 @@ cd
|
|||||||
cd ../../../../../././././../../../././../../../
|
cd ../../../../../././././../../../././../../../
|
||||||
pwd
|
pwd
|
||||||
|
|
||||||
export HOME=//
|
|
||||||
cd
|
|
||||||
pwd
|
|
||||||
|
|
||||||
export HOME=//bin/..////////////bin/../
|
|
||||||
cd
|
|
||||||
pwd
|
|
||||||
|
|
||||||
export HOME=///
|
export HOME=///
|
||||||
cd
|
cd
|
||||||
pwd
|
pwd
|
||||||
|
|||||||
@@ -153,93 +153,53 @@ env | grep -v -E '^_=' | sort
|
|||||||
cd ../
|
cd ../
|
||||||
env | grep -v -E '^_=' | sort
|
env | grep -v -E '^_=' | sort
|
||||||
|
|
||||||
export | grep -v -E '^declare -x _='
|
env | grep -v -E '^declare -x _='
|
||||||
env
|
|
||||||
|
|
||||||
export 1 _+ _OK _2? _OK2=VAR =NG OK3=
|
export 1 _+ _OK _2? _OK2=VAR =NG OK3=
|
||||||
export | grep -v -E '^declare -x _='
|
env | grep -v -E '^declare -x _='
|
||||||
env
|
|
||||||
|
|
||||||
export dquote='"' dollar='$' backslash='\' backquote='`' newline='\n'
|
export dquote='"' dollar='$' backslash='\' backquote='`' newline='\n'
|
||||||
export | grep -v -E '^declare -x _='
|
env | grep -v -E '^declare -x _='
|
||||||
env
|
|
||||||
|
|
||||||
export APPEND=1
|
|
||||||
export APPEND+=2
|
|
||||||
export | grep APPEND
|
|
||||||
env
|
|
||||||
|
|
||||||
export APPEND_NONE=1
|
export APPEND_NONE=1
|
||||||
export APPEND_NONE+=
|
export APPEND_NONE+=
|
||||||
export | grep APPEND_NONE
|
env | grep APPEND_NONE
|
||||||
env
|
|
||||||
|
|
||||||
export APPEND_NONE=
|
export APPEND_NONE=
|
||||||
export APPEND_NONE=
|
export APPEND_NONE=
|
||||||
export APPEND_NONE+=
|
export APPEND_NONE+=
|
||||||
export | grep APPEND_NONE
|
env | grep APPEND_NONE
|
||||||
env
|
|
||||||
|
|
||||||
export APPEND_EMPTY=""
|
export APPEND_EMPTY=""
|
||||||
export APPEND_EMPTY=""
|
export APPEND_EMPTY=""
|
||||||
export APPEND_EMPTY=""
|
export APPEND_EMPTY=""
|
||||||
export | grep APPEND_EMPTY
|
env | grep APPEND_EMPTY
|
||||||
env
|
|
||||||
|
|
||||||
export OVERWRITE=42
|
export OVERWRITE=42
|
||||||
export OVERWRITE=a
|
export OVERWRITE=a
|
||||||
export | grep OVERWRITE
|
env | grep OVERWRITE
|
||||||
env
|
|
||||||
|
|
||||||
export A=B=C=D
|
export A=B=C=D
|
||||||
export | grep A
|
env | grep A
|
||||||
env
|
|
||||||
|
|
||||||
export PATH
|
export PATH
|
||||||
export | grep PATH
|
env | grep PATH
|
||||||
env
|
|
||||||
|
|
||||||
export PWD
|
export PWD
|
||||||
export | grep PWD
|
env | grep PWD
|
||||||
env
|
|
||||||
|
|
||||||
export OLDPWD
|
export OLDPWD
|
||||||
export | grep OLDPWD
|
env | 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
|
unset OLDPWD
|
||||||
cd ..
|
cd ..
|
||||||
export OLDPWD=new_value
|
export OLDPWD=new_value
|
||||||
export | grep OLDPWD
|
env | grep OLDPWD
|
||||||
env
|
|
||||||
|
|
||||||
unset PWD
|
|
||||||
cd ..
|
|
||||||
export PWD
|
|
||||||
export | grep PWD
|
|
||||||
env
|
|
||||||
|
|
||||||
unset OLDPWD
|
unset OLDPWD
|
||||||
cd ..
|
cd ..
|
||||||
export OLDPWD
|
export OLDPWD
|
||||||
export | grep OLDPWD
|
env | grep OLDPWD
|
||||||
env
|
|
||||||
|
|
||||||
export =
|
export =
|
||||||
env
|
env
|
||||||
|
|||||||
@@ -10,6 +10,191 @@ cat Makefile | grep pr | head -n 5 | hello (NA)
|
|||||||
echo $?
|
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
|
# Race condition, unpredictable behaviour
|
||||||
|
|
||||||
|
|||||||
@@ -285,8 +285,8 @@ cd $(dirname $0)
|
|||||||
# for env, special treatment
|
# for env, special treatment
|
||||||
if [ "${in_file: -6}" == "env.sh" ]
|
if [ "${in_file: -6}" == "env.sh" ]
|
||||||
then
|
then
|
||||||
bash_execution="$( echo "$bash_execution" | sort | grep -v -e "LINES=" -e "COLUMNS=" -e "_=" -e"LESSCLOSE=" -e "LESSOPEN=" )"
|
bash_execution="$( echo "$bash_execution" | sort | grep -v -e "LINES=" -e "COLUMNS=" -e "_=" -e"LESSCLOSE=" -e "LESSOPEN=" -e "SHLVL=" )"
|
||||||
minishell_execution="$( echo "$minishell_execution" | sort | grep -v -e "LINES=" -e "COLUMNS=" -e "_=" -e"LESSCLOSE=" -e "LESSOPEN=" )"
|
minishell_execution="$( echo "$minishell_execution" | sort | grep -v -e "LINES=" -e "COLUMNS=" -e "_=" -e"LESSCLOSE=" -e "LESSOPEN=" -e "SHLVL=" )"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
compare_output "$bash_execution" "$minishell_execution" "$commands"
|
compare_output "$bash_execution" "$minishell_execution" "$commands"
|
||||||
|
|||||||
Reference in New Issue
Block a user