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
From qx
Similarly to system, if the string contains no shell metacharacters then it will executed directly.
Not sure what is included into "shell metacharacters" but a simple semicolon seems to suffice to force execution via the shell ...
lanx@ubuntu14-large:/tmp/sym$ perl -MCwd -E'say `pwd;` ' /tmp/sym lanx@ubuntu14-large:/tmp/sym$ perl -MCwd -E'say `pwd` ' /tmp/dir lanx@ubuntu14-large:/tmp/sym$
simplified code
Cheers Rolf
(addicted to the Perl Programming Language :)
Wikisyntax for the Monastery
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^6: Getting the absolute path of a script, without PWD (bug)
by perlancar (Hermit) on Jul 16, 2021 at 07:52 UTC | |
by LanX (Saint) on Jul 16, 2021 at 08:01 UTC | |
by perlancar (Hermit) on Jul 16, 2021 at 10:30 UTC | |
by LanX (Saint) on Jul 16, 2021 at 10:43 UTC |