The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > OS Specific Forums > HP-UX
Google UNIX.COM


HP-UX HP-UX (Hewlett Packard UniX) is Hewlett-Packard's proprietary implementation of the Unix operating system, based on System V.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
please help me regarding alias naree Shell Programming and Scripting 17 06-03-2008 01:14 AM
alias klannon Filesystems, Disks and Memory 6 04-27-2006 05:36 AM
Alias sunhata Shell Programming and Scripting 3 01-29-2006 03:03 AM
Alias guelpth UNIX for Dummies Questions & Answers 2 02-17-2005 03:29 PM
Alias klannon UNIX for Dummies Questions & Answers 2 03-10-2002 01:54 PM

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 11-12-2004
Registered User
 

Join Date: Nov 2004
Location: Phoenix AZ
Posts: 8
Question alias & parameters

We just recently moved from a DG-UX (Unix V) to HP 9000 servers running POSIX. I used the c-shell in the DG-UX system mainly because the bourne-shell did not support aliasing. Now in the default posix-shell of HP aliasing is supported. The main difference seams to be that in a c-shell you can pass the cmd-line arguments to an alias by using '\!*' - this is not the case in the posix-shell (sh-shell). I know I can "pass" arguments to an alias in posix - it gets appended to the aliased cmd, but if your alias (main reason in my opinion) is a complex set of piped cmds then the arguments get again only appended to the last cmd. Is there a way to pass arguments In the sh-shell (posix) similar to "\!*" in the c-shell?

THX in advance for any help!
Reply With Quote
Forum Sponsor
  #2 (permalink)  
Old 11-13-2004
zazzybob's Avatar
Registered Geek
 

Join Date: Dec 2003
Location: Melbourne, Australia
Posts: 2,100
The easiest way to do it is to convert your aliases to functions. Then you can do stuff like (this is for ksh, but sh-posix should be similar)

Code:
function somealias
{
    something $1 | something | something $2
}
and call it with "somealias arg_1 arg_2"

Cheers
ZB
Reply With Quote
Google UNIX.COM
Reply

Thread Tools
Display Modes




All times are GMT -7. The time now is 06:25 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