Created
April 5, 2026 06:19
-
-
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 | |
| sind auch Teil der Parameter expansion | |
| 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