Created
June 11, 2019 01:44
-
-
Save navono/88fc4eba35b7aeb453bfe37cccec65fb to your computer and use it in GitHub Desktop.
extract file name related info
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
#!/bin/bash | |
fullfilename=$1 | |
filename=$(basename "$fullfilename") | |
fname="${filename%.*}" | |
ext="${filename##*.}" | |
echo "Input File: $fullfilename" | |
echo "Filename without Path: $filename" | |
echo "Filename without Extension: $fname" | |
echo "File Extension without Name: $ext" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment