Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

Re^2: Getting the absolute path of a script, without PWD

by perlancar (Hermit)
on Jul 16, 2021 at 00:56 UTC ( [id://11135052]=note: print w/replies, xml ) Need Help??


in reply to Re: Getting the absolute path of a script, without PWD
in thread Getting the shell's version of working directory, without PWD's help

Thanks ikegami. Agreed. The working directory is a location chosen by the user. Due to symlinks one might reach the same location through different paths. And this state is in bash, there's no way of knowing this state unless bash exposes it.

Replies are listed 'Best First'.
Re^3: Getting the absolute path of a script, without PWD
by ikegami (Patriarch) on Jul 16, 2021 at 22:00 UTC

    It does. That's what $ENV{PWD} is. But to use that relies on the parent being process being bash, and it wouldn't be safe for a setuid script to use that.

    Seeking work! You can reach me at ikegami@adaelis.com

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://11135052]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others musing on the Monastery: (4)
As of 2024-03-29 07:06 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found