Last active
July 14, 2019 18:19
-
-
Save ilkayisik/f54e80d1c06d1845cf675026104da14d to your computer and use it in GitHub Desktop.
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
var="hello/my/name/is" | |
# everything after the first slash: | |
echo "${var#*/}" | |
# everything after the last slash: | |
echo "${var##*/}" | |
# everything before the first slash: | |
echo "${var%%/*}" | |
#everything before the last slash: | |
echo "${var%/*}" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment