On a VIOS:
# ls -al /home/padmin/.profile
lrwxrwxrwx 1 root system 21 Mar 10 2023 /home/padmin/.profile -> /usr/ios/cli/.profile
# ls -al /usr/ios/cli/.profile
-r--r--r-- 1 root system 6799 Aug 09 2022 /usr/ios/cli/.profile
So far, so good. But, why does a test to see if
/home/padmin/.profile
is a regular file, report that it
is (when it's actually a link)?
# if [[ -f /home/padmin/.profile ]];then^Jecho File^Jelse^Jecho Not a file^Jfi
File
The man page for
test
says that the -h and -L flags are supposed to return a True exit value if the specified Filename exists and is a symbolic link. As expected:
# if [[ -h /home/padmin/.profile ]];then^Jecho Link^Jelse^Jecho Not a link^Jfi
Link
# if [[ -L /home/padmin/.profile ]];then^Jecho Link^Jelse^Jecho Not a link^Jfi
Link
I get that the target of /home/padmin/.profile is a regular file... but /home/padmin/.profile itself is not! Is the above behavior intentional, or a bug?
------------------------------
Erich Wolz
------------------------------