LinuxQuestions.org
Latest LQ Deal: Complete CCNA, CCNP & Red Hat Certification Training 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 09-11-2008, 02:38 AM   #1
norto
LQ Newbie
 
Registered: Sep 2008
Posts: 3

Rep: Reputation: 0
Question Alias command assistance to simplify


Hoping someone could assist.
I'm hoping to simplify a command that we are using to sniff our network.
Command is
java PacketReporter trace.n 10:15 10:30 > filename

trace.n being a changing value and the times being a changing value.
How can I simplify this without typing the whole line while being able to enter the variables of the trace.n and times?
trace.n is a file with packet information.
 
Old 09-11-2008, 02:55 AM   #2
i92guboj
Gentoo support team
 
Registered: May 2008
Location: Lucena, Córdoba (Spain)
Distribution: Gentoo
Posts: 4,063

Rep: Reputation: 381Reputation: 381Reputation: 381Reputation: 381
Quote:
Originally Posted by norto View Post
Hoping someone could assist.
I'm hoping to simplify a command that we are using to sniff our network.
Command is
java PacketReporter trace.n 10:15 10:30 > filename

trace.n being a changing value and the times being a changing value.
How can I simplify this without typing the whole line while being able to enter the variables of the trace.n and times?
trace.n is a file with packet information.
This is more suitable for a function, in my opinion. In bash you could do

Code:
my_func () {
  java PacketReporter "$1" "$2" "$3" > filename
}
Put it in your ~/.bashrc and/or ~/.bash_profile, restart your bash session (i.e. exec bash) and now you should be able to just do

Code:
my_fync trace.n 10:15 10:30
 
  


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
tar command alias command rlg Linux - Newbie 0 03-11-2008 08:21 AM
directory for alias command ernestk Linux - Server 1 08-30-2007 06:56 PM
Creating Command Alias? carlosinfl Linux - General 3 07-14-2007 06:32 PM
Use for the alias command Metablade Linux - Newbie 4 10-12-2005 06:44 PM
alias command zeviddalop Linux - Newbie 3 01-12-2005 10:59 PM


All times are GMT -5. The time now is 10:32 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration