realpath as provided on Stack Overflow - not written by me!
C
Switch branches/tags
Nothing to show
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
README.md
realpath.c

README.md

realpath

Display the absolute path to a file or directory.

Usage

$ realpath /path/goes/../here

Installation

  1. Download the source code:

     $ curl -LO http://github.com/dtjm/realpath/raw/master/realpath.c
    
  2. Compile the source code:

     $ gcc -o realpath realpath.c
    
  3. Put it somewhere in your path:

     $ sudo install -m0755 realpath /usr/local/bin
    

Credits

Adam Liss, August, 2007 http://stackoverflow.com/questions/284662/how-do-you-normalize-a-file-path-in-bash

License

This program is provided "as-is" to the public domain, without express or implied warranty, for any non-profit use, provided this notice is maintained.