Code snippets

To convert a relative path to an absolute path:

readlink -f -- "$apath"

-f - Resolve to a target’s full path

Credit: StackOverflow

  • Better bash functions

    Using brackets () instead of {} for functions will run the function in a sub-shell.