Alias with variable? | Unix Linux Forums | UNIX for Dummies Questions & Answers

  Go Back    


UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !!

Alias with variable?

UNIX for Dummies Questions & Answers


Closed Thread    
 
Thread Tools Search this Thread Display Modes
    #1  
Old 10-03-2008
JustinT JustinT is offline
Registered User
 
Join Date: Oct 2008
Last Activity: 19 February 2010, 4:17 PM EST
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Alias with variable?

I'm new to UNIX. I have to run executables often, and they all have a common prefix "prefix_". Now I'm wondering if I can make an alias where I can type run xyz that will then execute "./prefix_xyz" ?

Thanks in advance.
Sponsored Links
    #2  
Old 10-03-2008
nullwhat nullwhat is offline
Registered User
 
Join Date: Sep 2008
Last Activity: 27 December 2008, 9:57 PM EST
Posts: 25
Thanks: 0
Thanked 0 Times in 0 Posts
ummm

alias runme="./prefix_$1"

runme xyz



should do

example

alias love="echo $1"

love me
Sponsored Links
Closed Thread

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Create alias files (not alias commands) Alexander4444 UNIX for Dummies Questions & Answers 3 04-16-2012 10:57 AM
Passing variable to Alias in Hp kshell firestar UNIX for Dummies Questions & Answers 1 08-29-2011 12:17 PM
How to define a variable with variable definition is stored in a variable? freddy1228 Shell Programming and Scripting 1 11-12-2009 03:39 AM
expanding alias from a variable locutus01 Shell Programming and Scripting 7 09-30-2009 02:36 AM
How to get the alias,when we have the IP. preethgideon UNIX for Dummies Questions & Answers 2 07-24-2007 02:53 PM



All times are GMT -4. The time now is 11:56 PM.