Skip to content

Instantly share code, notes, and snippets.

@navono navono/file.sh
Created Jun 11, 2019

Embed
What would you like to do?
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
You can’t perform that action at this time.