LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
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 03-06-2007, 08:27 AM   #1
Maverick1182
Member
 
Registered: Aug 2004
Location: London
Distribution: Gentoo
Posts: 277

Rep: Reputation: 30
Custom command


Hi there, i am wondering how to do the following, i want to run three commands in a sequence:

time , emerge , sendmail

time is standard just to tell me how long the emerge (gentoo) took. Sendmail simply runs a bash script which sends an email to my office when the command is done.

the main issue is that i want to type a lot of options in the command line which will cahnge from time to time as i want to install different programs eg. "myemerge -u firefox" and i and the system to copy the options preceeding myemerge and then paste it to the actual command like.

I type : "myemerge firefox vlc thunderbird"

"time emerge -u firefox vlc thunderbird && sendmail"

how can I make a script which pulls out what i type in the command when i run it and then inserts it in the appropriate place when the whole command sequence is run?
 
Old 03-06-2007, 08:55 AM   #2
hepburnenthorpe
Member
 
Registered: Jun 2006
Location: Sydney
Distribution: Gentoo + Debian
Posts: 132

Rep: Reputation: 15
At its simplest.

Code:
#!/bin/bash

time emerge -u "$@" && sendmail

Last edited by hepburnenthorpe; 03-06-2007 at 08:56 AM.
 
  


Reply



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
Setting a custom command drimades Linux - Kernel 1 11-15-2006 09:04 AM
Usermin Custom Command help please AlphaNate Linux - Software 0 09-12-2005 08:16 AM
custom cd command glingon Linux - General 4 11-01-2004 07:39 PM
Custom Command? - Excuting Program SilverX Slackware 11 09-20-2004 03:49 PM
debian - custom startup command =X¥®µ§= Linux - Distributions 8 04-28-2003 03:38 PM

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

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

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
Open Source Consulting | Domain Registration