-
Notifications
You must be signed in to change notification settings - Fork 0
/
MSearch.sh
executable file
·63 lines (43 loc) · 1.22 KB
/
MSearch.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
#! /bin/bash
########################################################
# Bash script to match MP3 song name across computer #
# and play it with suitable player #
# Copyright- Saket Harsh (IIT Kanpur) #
# E-Mail- [email protected] #
########################################################
cd ~
name="$1"
count=0
while [ $count -eq 0 ]
do
count=$( ls -R | egrep ".mp3$" | grep -i -c "$name")
while [ $count -eq 0 ]
do
echo "No such .mp3 Song found. Try with another name:- \n "
read name
count=$( ls -R | egrep ".mp3$" | grep -i -c "$name")
done
while [ $count -gt 1 ]
do
a=$( ls -R | egrep ".mp3$" | grep -i "$name" )
echo "Multiple File names found. Select any one from the listed below:-"
echo "$a"
echo " Be more specific :-"
read name
count=$( ls -R | egrep ".mp3$" | grep -i -c "$name" )
done
a=$( ls -R | egrep ".mp3$" | grep -i "$name" )
cd ~/RmSearch/
done
cd ~/RmSearch/
./EXT-manager.py "$a"
if [ "$(cat songlist2.txt)" ]
then
fullpath=$(cat songlist2.txt)
rm -rf songlist.txt
rm -rf songlist2.txt
cd ~
vlc "$fullpath"
else
echo "The file either does not exist or is not and mp3 file.... Exiting!!"
fi