in reply to Re^4: Getting the absolute path of a script, without PWD (bug?)(update)
in thread Getting the shell's version of working directory, without PWD's help
after further investigation, it seems that `pwd` inside Perl doesn't default like pwd in bash ... which is unexpected
The answer is perhaps this in perlop for the qx//:
if the string contains no shell metacharacters then it will executed directly.
So although in general qx// uses the shell, if we say `pwd` then perl will execute /bin/pwd, which defaults to -P. If we say `bash -c pwd` then bash will execute its shell builtin version of pwd, which defaults to -L.
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^6: Getting the absolute path of a script, without PWD (bug?)(update)
by choroba (Cardinal) on Jul 16, 2021 at 08:52 UTC | |
by perlancar (Hermit) on Jul 16, 2021 at 10:20 UTC |