Review your favorite Linux distribution.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!


  Search this Thread
Old 06-07-2007, 03:03 AM   #1
LQ Newbie
Registered: May 2007
Posts: 2

Rep: Reputation: 0
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 .


#! /bin/bash

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

# 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.

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 .
Old 06-07-2007, 05:42 AM   #2
LQ Addict
Registered: Jul 2002
Location: East Centra Illinois, USA
Distribution: Debian stable
Posts: 5,908

Rep: Reputation: 354Reputation: 354Reputation: 354Reputation: 354
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.
Old 06-07-2007, 12:17 PM   #3
LQ Newbie
Registered: May 2007
Posts: 2

Original Poster
Rep: Reputation: 0
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 .
Old 06-07-2007, 01:20 PM   #4
Registered: May 2007
Location: UK
Distribution: LFS,Slackware,Slamd64,NetBSD
Posts: 102

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


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Shell Scripting: Getting a pid and killing it via a shell script topcat Programming 15 10-28-2007 03:14 AM
Shell Scripting Help Elguapo Programming 1 09-07-2006 08:03 AM
teaching shell scripting: cool scripting examples? fax8 Linux - General 1 04-20-2006 05:29 AM
shell interface vs shell scripting? I'm confused jcchenz Linux - Software 1 10-26-2005 04:32 PM
shell scripting pcdebb Linux - Newbie 17 11-20-2003 04:49 PM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 02:20 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration