Skip to content

Instantly share code, notes, and snippets.

@navono
Created June 11, 2019 01:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save navono/88fc4eba35b7aeb453bfe37cccec65fb to your computer and use it in GitHub Desktop.
Save navono/88fc4eba35b7aeb453bfe37cccec65fb to your computer and use it in GitHub Desktop.
extract file name related info
#!/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