LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Shell Scripting HELP! (https://www.linuxquestions.org/questions/linux-newbie-8/shell-scripting-help-559825/)

perspicuus 06-07-2007 02:03 AM

Shell Scripting HELP!
 
hello friends ,
presently i am using ubuntu6.06.i am pretty new to linux . My question is like this

suppose i write a shell script that starts playing a song using mp3blaster .now i want to write some more commands in the script that controls the this player like its sound

NOTE:I am doing this from the Console .

example

[------------------------------------------------------------------------------------------------]
#! /bin/bash
#example.sh

mp3blaster xyz.mp3 # xyz.mp3 is in the same directory in which i am executing example.sh

# here i need a body that controls this mp3blaster plyer
# like i need to control increasing and decreasing the sound level automatically while execution is being done.
#
#
#
exit
[--------------------------------------------------------------------------------------------------]


my question is not regarding the mp3blaster . it is for any console based application.

i would appreciate greatly if someone can reply to this logically . i do have some basic idea about navigating the shell and the shell scripting in general.

thanking all in advance .

bigrigdriver 06-07-2007 04:42 AM

Have your script start with a menu of options for the user. Something like:
1. play a recording
2. increase volume
3. decrease volume
4. quit

Then a case argument to call a function to carry out the task:
case 1) play a recording
case 2) increase volume
case 3) decrease volume
case 4) quit

Have the script return from the function to the menu and wait for the next input.

perspicuus 06-07-2007 11:17 AM

hello bigrigdriver,
it does give a lotof keybindings,thats correct .but i dont want to press 4 everytime to quit (in ur example). the shell has to do that for me.
let me make it more specific .
suppose i want to play the song for 20 secs and then it should quit automatically.
how to achieve that with a script.

i hope this makes my question a bit more clear.

thanking all in advance .

dawkcid 06-07-2007 12:20 PM

For playing mp3s, try using mplayer instead, it can do everything you've mentioned.


All times are GMT -5. The time now is 05:46 AM.