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
passing strings as arguments iago UNIX for Dummies Questions & Answers 1 08-22-2007 07:04 AM
Passing and using arguments in Scripts. David.Vilmain Shell Programming and Scripting 1 11-13-2006 02:32 PM
Passing arguments to a Perl script jyoung Shell Programming and Scripting 4 12-29-2004 02:57 PM
Passing arguments to a script Kevin Pryke Shell Programming and Scripting 3 06-14-2002 06:06 AM
passing arguments jpprial UNIX for Dummies Questions & Answers 4 04-03-2001 08:13 AM

Closed Thread
 
Submit Tools LinkBack Thread Tools Search this Thread Display Modes
  #1  
Old 10-23-2001
Registered User
 

Join Date: Oct 2001
Posts: 7
Passing arguments to an alias

I want to have an alias for the command

fold -78 filename | lp

How do I set my alias so that the argument passed is filename ??

alias lp='fold -78 | lp'

then

lp filename

wont work cuase this is

fold -78 | lp filename
Forum Sponsor
  #2  
Old 10-23-2001
PxT's Avatar
PxT PxT is offline
Registered User
 

Join Date: Oct 2000
Location: Sacramento, CA
Posts: 909
It depends on your shell. For example, in bash it is not possible to do what you ask, the man page suggests using a function instead. In tcsh you would use:

alias lp 'fold -78 \!* | lp'


Syntax for other shells may vary. Check the man page for details.
Google The UNIX and Linux Forums
Closed Thread

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes




All times are GMT -7. The time now is 11:49 PM.


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

Content Relevant URLs by vBSEO 3.2.0