Last active
February 8, 2018 14:21
-
-
Save fradaloisio/87312d53e479637ce654eb3a638dfaff to your computer and use it in GitHub Desktop.
This file contains 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
[vagrant@localhost ~]$ FILE="/this/is/the/file.ext" | |
# dirname | |
[vagrant@localhost ~]$ echo "${FILE%/*}" | |
/this/is/the | |
#basename | |
echo "${FILE##*/}" | |
file.ext | |
# Full path whitout extension | |
[vagrant@localhost ~]$ echo "${FILE%.*}" | |
/this/is/the/file | |
# Extension | |
[vagrant@localhost ~]$ echo "${FILE#*.}" | |
ext |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment