Get just the filename from a path in a Bash script [duplicate]

How would I get just the filename without the extension and no path?

The following gives me no extension, but I still have the path attached:

source_file_filename_no_ext=${source_file%.*}

6 Answers
6

Leave a Comment