Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

14
  • 2
    @dhardy. Not sure I understand your comment. What is it in the solution proposed here that excludes use from an interactive environment? ... btw, just like all the other alternative answers presented on this page.
    – peterh
    Commented Jan 26, 2014 at 11:39
  • 1
    Neither realpath nor realink is 'a standard Unix utility' so if that's what you were after then you've gone with the wrong answer.
    – peterh
    Commented Feb 4, 2014 at 13:53
  • 6
    I would like to add that realpath comes from coreutils package, which also contains tools such as who, touch or cat. It's quite standar set of GNU tools, so you can be quite sure that this is installed on almost any linux based machine.That said, you are right: there are 2 issues with it: i) you will likely miss it in default install on non GNU unix systems (like OpenBSD) ii) this tools was introduced in version 8.15 (so it's quite new, from 2012), so you will miss it on long term stable systems (like RHEL 6).
    – marbu
    Commented Feb 6, 2014 at 22:22
  • 1
    Well, it seems at least that Continuum Analytics (makers of the Anaconda Python distribution) liked this answer. It is implemented (with a reference linking back here) in their "activate" script, which is used to activate virtual environments created by the conda tool. So… good one!
    – wjv
    Commented Mar 6, 2014 at 11:39
  • 4
    @marbu realpath is not present on Ubuntu 14.04, or on Debian Wheezy. It may become somewhat standard over time, but it's certainly not now. Also note that the OP didn't say anything about linux or GNU. Bash is more widely used than that.
    – mc0e
    Commented Nov 27, 2014 at 11:45