JustBash.Commands.Realpath (JustBash v0.4.0)

View Source

The realpath command - print the resolved absolute path.

Resolves ., .., and symlinks in the virtual filesystem.

How much of the path has to exist depends on the mode, as in GNU realpath:

  • default — every component but the last must resolve to a directory, so realpath /nope canonicalises and exits 0 while realpath /nope/deep/x does not
  • -e — the whole path must exist
  • -m — nothing has to exist