Public feed #725794

Barney

public shellscript v1 · immutable
Raw Edit
·published 2007-10-04 18:18 UTC
rendered paste body
#!/bin/bash#Variables!db1="/media/Music/Downloaded/Torrents/.torrent-sorter-ignore"db2="/media/Music/Downloaded/Torrents/.torrent-sorter-tmp"db3="/media/Music/Downloaded/Torrents/.torrent-sorter-tmp2"datadir="/media/Music/Downloaded/Torrents/"linkdir="/media/Music"zenitycommand=rm "$db2" &>/dev/nulltouch "$db2"#test="initial value"#unsorted=$(find "$datadir" -maxdepth 1 -type d -print | sort)#  sorted=$(find "$linkdir" -maxdepth 1 -lname "*" -printf "%l\n")#find "/media/Music" -maxdepth 1 -lname "*" -printf "%l\n" |while read file; do	found=0	test="woot"#	echo $test	while read line; do		if [[ "$line" == "$file" ]]; then			found=1		fi	done < <(find "$linkdir" -maxdepth 1 -lname "*" -printf "%l\n")	if [[ $found != 1 ]]; then		found2=0		while read line2; do			test=$test3			if [[ "$line2" == "$file" ]]; then				found2=1			fi		done < "$db1"		if [[ $found2 != 1 ]]; then			length=${#datadir}			writeit="${file: $length}"			if [[ $writeit != "" ]]; then				echo "" >> $db2				echo "$writeit" >> $db2			fi		fi	fidone < <(find "$datadir" -maxdepth 1 -type d -print | sort)output=$(cat $db2 | zenity --list --text "Select which directories to symlink" --checklist --column " " --column "Name")#echo $outputOFS=IFS IFS=\| ;for line in $output; do 	while read mp3; do		while read tag; do 			case "$tag" in 				artist:*) artist=${line#*: };; 				album:*) album=${line#*: } ;; 				year:*) year=${line#*: } ;; 			esac; 			echo "$tag"		done < <(id3ed -i "$mp3" | tr -s '/' '-' | tr '[:upper:]' '[:lower:]')		echo "$mp3"		echo "$artist - $year - $album"		break;	done < <(find "$datadir$line" -name \*.mp3 -type f -print | sort)doneIFS=$OFS#echo "$zenitycommand" > $db2#echo $zenitycommand#zenity --list --text "Select which directories to symlink" --checklist --column " " --column "Name" $zenitycommand#echo "lol $test"#echo $zenitycommand#output=$(zenity --list --text "Select which directories to symlink" --checklist --column " " --column "Name" $zenitycommand)