Closed habvi closed 1 year ago
$ pwd
/home/user42/42tokyo/minishell/testdir/A/B
$ chmod 000 ../
$ cd ../
bash: cd: ../: Permission denied
$ cd ../../
bash: cd: ../../: Permission denied
$ cd ../../../
bash: cd: ../../../: Permission denied
$ cd ../../../../
bash: cd: ../../../../: Permission denied
$ mkdir A A/B && cd A/B
rm -rf ../../A
bash (new or not)
$ cd ..
cd: error retrieving current directory: getcwd: cannot access parent directories: No such file or directory
$ declare -p | grep PWD
declare -x OLDPWD="/home/user42/42tokyo/minishell/testdir/A/B"
declare -x PWD="/home/user42/42tokyo/minishell/testdir/A/B/.."
$ cd ..
$ declare -p | grep PWD
declare -x OLDPWD="/home/user42/42tokyo/minishell/testdir/A/B/.."
declare -x PWD="/home/user42/42tokyo/minishell/testdir"
$ cd -
bash: cd: /home/user42/42tokyo/minishell/testdir/A/B/..: No such file or directory
user42@armlinux bash4.4_2[1] $ ~/42tokyo/minishell/testdir (update-redirect-use-dev)
<path>
minishell/ dir1/dir2/dir3/dir4
minishell/ link -> dir1/dir2/dir3
minishell/ srcs
<arg>
minishell/ link
cd ../srcs
minishell/ link/../srcs
getcwd: /home/user42/42tokyo/minishell/dir1/dir2/dir3
<link>
cd link
link
chdir(../srcs) : failure
.. -> minishell or dir2 ?
path
chdir(../dir3) : success
ft_cd を見直し