2 ms·
> `readlink -f` Other languages have this also. In fact it's a C language system call in Linux, though it only goes one indirection level at a time. This is
by JJMcJ 4y ago
> `readlink -f`
Other languages have this also. In fact it's a C language system call in Linux, though it only goes one indirection level at a time.
This is useful if you run a script and want to use files contained in the directory where the script is located. This comes up if you have a symlink to the script in any /something/something-else/bin directory.
Use cases:
Script needs its own location for e.g. configuration files.
User of the script needs the location for e.g. another script that needs to be run that isn't in the search path.