The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Dummies Questions & Answers
Google UNIX.COM


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 !!

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Unable to create alias mumashankar UNIX for Dummies Questions & Answers 3 05-01-2008 07:21 AM
Create Alias on Desktop yodomino6 UNIX for Dummies Questions & Answers 0 02-19-2008 10:36 AM
I want to create a command alias cstovall UNIX for Dummies Questions & Answers 2 12-03-2002 06:20 AM
Create an alias mozark High Level Programming 1 10-08-2002 07:17 PM
1 alias 2 commands 1 argument seba UNIX for Dummies Questions & Answers 3 08-31-2001 08:26 PM

Reply
 
Submit Tools LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 07-11-2007
Registered User
 

Join Date: Mar 2006
Posts: 25
Stumble this Post!
Question How to create a alias with an argument

If I want to create an alias called "cdr", and this alias need an argument (for example arg1)followed by "cdr", the result should go to the directory like "/home/ting/arg1/report/logs", the command should look like below,

alias cdr arg1 "cd /home/ting/\!$1/report/logs" (not working):

Anybody can tell me how to create this alias?

Thanks in advance!
Reply With Quote
Forum Sponsor
  #2 (permalink)  
Old 07-11-2007
reborg's Avatar
Administrator
 
Join Date: Mar 2005
Location: Ireland
Posts: 3,513
Stumble this Post!
I assume you're using (t)csh? IN this case the following should work for you:

Code:
 
alias cdr 'cd /home/ting/\!*/report/logs'
Reply With Quote
Google The UNIX and Linux Forums
Reply

Thread Tools
Display Modes




All times are GMT -7. The time now is 07:39 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008 The CEP Blog All Rights Reserved -Ad Management by RedTyger Visit The Global Fact Book

Content Relevant URLs by vBSEO 3.2.0