Last active
August 26, 2026 09:16
-
-
Save dewomser/7ee7bac0a6ecf0ae584d457b8dfcd8c7 to your computer and use it in GitHub Desktop.
Bash Basename, Dirname und Parameter expansion
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #Linux #Bash | |
| basename und dirname | |
| kann man auch durch Parameter expansion ersetzen | |
| lolo="~/gogo/usr/bin/lolo.txt.gz" | |
| dirname $lolo | |
| #oder | |
| echo "${lolo%/*}" | |
| #=> ~/gogo/usr/bin | |
| basename $lolo | |
| #oder | |
| echo "${lolo##*/}" | |
| #=> lolo.txt.gz |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment