Curiously I found "which" command to fail in one occasion..
Decription:
pwd command gives 277 characters (I tend to give a slightly long name for each directory and love to work
with subdirectories to help me to navigate through trees, so far no major problem. Even my Fortran program
has a default of 500 characters to hold an absolute path names of a file)
seems to cause which command to fail:
which bash-a-script
Can't get current working directory
Is this is the limitation of
Linux centos69-hp 2.6.32-754.2.1.el6.x86_64 #1 SMP Fri Jul 13 12:50:12 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux
Wonder if CentOS 7.x does not have this problem.
which command will fail if pwd output is very long?
Re: which command will fail if pwd output is very long?
CentOS 7 has the same problem. If you run which which (somewhere where it's allowed) you'll see that which is probably an alias:
Apparently it's the --show-dot option that is causing the problem.
Code: Select all
$ which which
alias which='alias | /usr/bin/which --tty-only --read-alias --show-dot --show-tilde'
/usr/bin/which