home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #31 / NN_1992_31.iso / spool / comp / unix / shell / 5173 < prev    next >
Encoding:
Text File  |  1992-12-28  |  1.2 KB  |  35 lines

  1. Newsgroups: comp.unix.shell
  2. Path: sparky!uunet!seas.smu.edu!convex!rdavis
  3. From: rdavis@convex.com (Ray Davis)
  4. Subject: Re: How to do csh-like alias in ksh?
  5. Message-ID: <rdavis.725565960@connie.de.convex.com>
  6. Sender: usenet@convex.com (news access account)
  7. Nntp-Posting-Host: connie.de.convex.com
  8. Organization: CONVEX Computer Corporation, Richardson, Tx., USA
  9. References: <1992Dec24.022550.8880@microsoft.com>
  10. Distribution: pnw
  11. Date: Mon, 28 Dec 1992 18:06:00 GMT
  12. X-Disclaimer: This message was written by a user at CONVEX Computer
  13.               Corp. The opinions expressed are those of the user and
  14.               not necessarily those of CONVEX.
  15. Lines: 18
  16.  
  17. russsan@microsoft.com (Russell Sanchez) writes:
  18.  
  19. >Is there any way to do a csh-like 'bang' in ksh aliases?  I'm basically
  20. >trying to do alias substitution (including parser metasyntax if possible).
  21. >For example, I want to convert the csh alias...
  22. >alias ff 'find . -name /!* -print'
  23. >...to ksh, something like...
  24. >alias ff='find . -name ???? -print'
  25. >...but what is the ????.  ksh doesn't seem to parse commands like csh.
  26.  
  27. Not possible with aliases, but with functions:
  28.  
  29.     function ff { find . -name $* -print; }
  30. or:    ff() { find . -name $* -print; }
  31.  
  32. if you prefer.
  33.  
  34. Ray
  35.