Created
July 29, 2016 20:56
-
-
Save seyonv/ceea9b9780128720fbcffd58754c5038 to your computer and use it in GitHub Desktop.
Using sed to separate the name & extension parts of a string
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
FILE_NAME=$(echo "$IN_FILE" | sed 's/\([a-zA-Z0-9_]*\).[a-zA-Z0-9]*/\1/') | |
FILE_EXT=$(echo "$IN_FILE" | sed 's/[a-zA-Z0-9_]*\(.[a-zA-Z0-9]*\)/\1/') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment