All pastes #2097531 Raw Edit

Mine

public text v1 · immutable
#2097531 ·published 2011-12-30 18:18 UTC
rendered paste body
#! /bin/bash
#looks for m4v extension and, if found, looks for file with the same name ending in mkv, and if found, deletes the mkv

mypath="$1"
for NAME in "$1"/*; do
	echo "Processing: " "$NAME" 
	filename=$(basename $NAME)
	extension=${filename##*.}
	filename=${filename%.*}
	echo "Extension is: " "$extension"
	echo "Filename is: " "$filename"
	if [ "$extension" = "m4v" ]; then 
		echo "Inside if"
		find -name "$filename".mkv -exec echo "FOUNDIT" \;
	fi
done