Welcome to the most active Linux Forum on the web.
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 03-06-2007, 09:27 AM   #1
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, 09:55 AM   #2
Registered: Jun 2006
Location: Sydney
Distribution: Gentoo + Debian
Posts: 132

Rep: Reputation: 15
At its simplest.


time emerge -u "$@" && sendmail

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


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

All times are GMT -5. The time now is 09:44 AM.

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