Help with bash script
hello im trying to make a menu type mp3 playist program from a bash script. im stuck on assigining the menu the variable. Please if anyone can throw some feedback whats wrong here thanks in advance.
im using mplayer and playlist needs to reside in /home/Fedora11 and mp3 will reside in /home/Fedora11/MP3 Code:
#!/bin/bash |
First of all you forgot to close the function definition of mk_playlist().
Quote:
|
Quote:
I need to create a playlist menu. list i have put in the script. be able to read the mp3 in /home/Fedora11/mp3 and make a playlist in /home/Fedora11 but i have the sligtest clue even where to start?? |
Quote:
Relax. Smile. Count to 100 while breathing deeply :) Surely we can help you. The first step is to be very clear about what you want to do. We're pretty smart but not mind readers so you are going to have to tell us. You're new to all this and probably don't know exactly what you want to do but that's OK -- we can work together on that. Tell us the best you can, tell us what you are uncertain about and we can go forward from there. |
Try typing 'help select' at a bash prompt.
|
ok i am using mplayer.
i would like the ability to create display and remove playlists. Playlist will reside in /home/Fedora11 and the mp3s are in /home/Fedora11/MP3 I also need a database file that shows the path directory. ability to play mp3 and add mp3 to the playlist and check for duplicates. I want it in sort of a menu type options something like this Code:
## Functions for each task I have been bouncing back from forums and reading but really unsure what the next step to acutally make the options work. If i could get one to work i could try to geth the others to work.. Also a friend said that this has to be linear so the first part of the script has to come after the menu?? |
Thanks for more info :)
I don't use any music players so can't help with that side of things but I can help with the scripting side. Shell functions need to be defined before they are called so your layout is the right one. In your original code you had echo e- You can check that the menu is calling the functions by something like Code:
edit_playlist() { |
Ok i got some progress here. Tackled the play mp3 so far
modded it a bit with litle help i added this cmd but it doesnt like when i enter in songs with spaces how can i fix this?? Code:
play_mp3() { |
read splits the input into words. The delimiters are in IFS.
Try the following: Code:
IFS= read SONG |
this mite help:
http://www.linuxquestions.org/questi...center-719104/ |
Quote:
Code:
play_mp3() { |
Got it now...
Code:
play_mp3() { |
Ok onto next line..
I need help with the copy file function. I got the basic commands but how can you check for duplicates?? Code:
copy_mp3() { |
You could create a temp file with a directory listing. Then you can read the file line by line to see if the file exist. If it does, then do nothing, if it doesn't then copy the file.
Code:
copy_mp3() { |
This Post would probably do better in the Programming forum
|
All times are GMT -5. The time now is 12:52 PM. |