🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.unix.shell
Article #46

Re: shell problems

#46
From: M.C. Wong
Date: Mon, 02 Nov 1992 15:16
36 lines
1604 bytes
In article <1992Oct31.115106.552@latcs1.lat.oz.au> I wrote :
>
>  3) How can I make an alias that reads from stdin ? I have got a small
>     alias (csh/tcsh) :
>
>     alias upcase 'echo \!* | tr "[a-z]" "[A-Z]"' that converts its argument
>     to upper case. Hoever it will not work properly when I pipe the output
>     of another command to it , ie :
>
>     prog | upcase , doesn't work! 
>
>     Also, I don't want to do : upcase `prog` .
>
>
>  Email replies are welcomed!!
>
>
>  - wongm@latcs1.lat.oz.au
Hi,
  I posted 3 questions about shells, what actuall I meant for 3) is that
: I would like to make an alias (not shell script) that can be invoked
in either way as :
		i) upcase arg1 [arg2 ... arg N], as well as
        ii) filterprogram | upcase.
But I will like is to achieve ii) without pipeline.

  That is, the alias has to figure out if it is going to read its command 
line argument (if they exist) or from its stdin (if command line args
don't exist).

  Many thanks in advance. Also I would really like to hear from some of
the Unix gurus for the first 2 questions as I haven't got any (correct)
replies yet. 


- wongm@latcs1.lat.oz.au
Technical Details
Message-ID: <1992Nov2.151613.20581@latcs1.lat.oz.au>
Path: arc1-ca.pugleaf.net!sparky!uunet!munnari.oz.au!ariel.ucs.unimelb.EDU.AU!ucsvc.ucs.unimelb.edu.au!lugb!latcs1!wongm
References: <1992Oct31.115106.552@latcs1.lat.oz.au>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!sparky!uunet!munnari.oz.au!ariel.ucs.unimelb.EDU.AU!ucsvc.ucs.unimelb.edu.au!lugb!latcs1!wongm
Newsgroups: comp.unix.shell
Subject: Re: shell problems
Message-ID: <1992Nov2.151613.20581@latcs1.lat.oz.au>
From: wongm@latcs1.lat.oz.au (M.C. Wong)
Date: Mon, 2 Nov 1992 15:16:13 GMT
References: <1992Oct31.115106.552@latcs1.lat.oz.au>
Organization: Comp Sci, La Trobe Uni, Australia
Lines: 39