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

Sure - there may be some cases where you might want the symlink name rather than the target. But that's not what you've asked. Your question says "... without PWD". Why impose this arbitrary restriction? If you want what $PWD gives, why not just use it?


🦛

  • Comment on Re^3: Getting the absolute path of a script, without PWD

Replies are listed 'Best First'.
Re^4: Getting the absolute path of a script, without PWD
by perlancar (Hermit) on Jul 15, 2021 at 12:34 UTC
    Yes, that's just a curiosity. I'm using PWD right now.