LinuxQuestions.org
Latest LQ Deal: Linux Power User Bundle
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
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!

Notices


Reply
  Search this Thread
Old 06-07-2007, 03:03 AM   #1
perspicuus
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 .

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

Rep: Reputation: 353Reputation: 353Reputation: 353Reputation: 353
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
perspicuus
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
dawkcid
Member
 
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.
 
  


Reply


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

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 08:27 AM.

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