Resolve Relative to Absolute Paths with readlink

Written by James McDonald

July 31, 2010

Just wanted to resolve a relative file path so that I can pass it as an absolute path to a program.


ABS_PATH=$(readlink -f "$1")

cd $QCAD_DIR && ./qcad $ABS_PATH

Credits: Andy


Submit a Comment

Your email address will not be published. Required fields are marked *

You May Also Like…

Scam call from “Telstra”

Just had a call from a man with a sub-continental accent from caller ID 0734946596 Told me there was problem with my...

PC Build

I recently built myself a PC using the SilverStone SG13 Case. I am planning to use it as a Hot Spare. So any client...