home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #16 / NN_1992_16.iso / spool / comp / os / linux / 6372 < prev    next >
Encoding:
Text File  |  1992-07-21  |  1.1 KB  |  37 lines

  1. Newsgroups: comp.os.linux
  2. Path: sparky!uunet!zaphod.mps.ohio-state.edu!uwm.edu!daffy!saavik.cs.wisc.edu!quale
  3. From: quale@saavik.cs.wisc.edu (Douglas E. Quale)
  4. Subject: Re: lp or something like it?
  5. Message-ID: <1992Jul22.055139.14115@daffy.cs.wisc.edu>
  6. Sender: news@daffy.cs.wisc.edu (The News)
  7. Organization: Undergraduate Projects Lab, UW Madison
  8. References: <kBN8NB4w165w@ssg.com> <l6omtcINN5g4@priddy.cs.utexas.edu>
  9. Date: Wed, 22 Jul 1992 05:51:39 GMT
  10. Lines: 25
  11.  
  12. In article <l6omtcINN5g4@priddy.cs.utexas.edu> woody@cs.utexas.edu (James Woodgate) writes:
  13. >
  14. >How can I make this script a Bash Alias???
  15. >
  16.  
  17. I'm posting this rather than using email since I think maybe a fair
  18. number of folks might be interested in bash aliases.
  19.  
  20. Csh aliases can take arguments.  Bash aliases are like ksh aliases and
  21. do not permit arguments.  In order to do this, you want to use a bash
  22. function:
  23.  
  24. lp()
  25. {
  26.  cat < $1 > /dev/lp1 &
  27. }
  28.  
  29. This is also the POSIX compliant solution.  (POSIX sh(1) has functions
  30. but not aliases.)
  31.  
  32. I think someone will probably get ambitious and port an lp daemon to
  33. Linux soon.
  34. -- 
  35. Doug Quale
  36. quale@saavik.cs.wisc.edu
  37.