Originally Posted by coexistance
See the "~/docs/work/todo.txt" thing?
That's a relative path that does exactly the same as the full path but is easier to type and is dependent of your working directory.
Actually that is an aliased path (ie. ~ is an alias for your home directory)
A relative path would be something like:
Depending on where you execute the script, this will look in the current directory for a directory called 'docs'.
The difference with the above is:
Irrelevant of where you are this will still look in your
home path for 'docs' directory.
The real gotcha here is that if someone else executes the script it will look in their
Whereas a full (or absolute) path would be:
This will work no matter who calls it or where it is called from (assuming of course you have the permissions to the directory and file)