Timeline for Obtain script current directory (so that I can do include files without relative paths and run the script from everywhere)
Current License: CC BY-SA 3.0
2 events
| when toggle format | what | by | license | comment | |
|---|---|---|---|---|---|
| Apr 7, 2018 at 9:23 | comment | added | Alexar |
not if it is a symlink. This one is the most reliable I have found: current_dir=$(dirname $(readlink -f $0))
|
|
| Mar 31, 2016 at 9:11 | history | answered | user3450548 | CC BY-SA 3.0 |