Applikations-/Script-Verzeichnis ermitteln
| ID | 285 |
|---|---|
| Link Reference | Not set |
| Link Credits | https://stackoverflow.com/questions/59895/how-to-get-the-source-directory-of-a-bash-script-from-within-the-script-itself |
| Link Technical Documentation | Not set |
| PlCodelang | Bash Script |
| PlGroup | Filehandling |
| PlItemTitle | Applikations-/Script-Verzeichnis ermitteln |
| Code | #!/bin/sh # The script is located in /tmp/abc/myscript.sh export AppPath=$(dirname $0) echo $0 # /tmp/abc/myscript.sh echo $AppPath # /tmp/abc |
| Result Example | /tmp/abc/myscript.sh /tmp/abc |