Case insentitive basename

Published: Wednesday, Dec 26, 2007 Last modified: Thursday, Dec 3, 2020

Better than basename:

file=mvi_0288.avi; echo ${file%.*}

mvi_0288

Lets do extensions too:

#!/bin/bash

for i in $@

do

EXT=${i##*.}

if [ $EXT = 'iso' ] || [ $EXT = 'img' ]; then

        md5sum $i > $i.MD5SUM

fi

done

Make a change