![]() |
|
|
|
|
|||||||
| Forums | Portal | Register | Forum Rules | FAQ | Contribute | Members List | Arcade | Search | Today's Posts | Mark Forums Read |
| 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 !! |
|
|
||||
| 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 |
|
|
Submit Tools | LinkBack | Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
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
|
||||
|
||||
|
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 |