echo question

Tom Christiansen tchrist at convex.COM
Sat Mar 9 00:20:00 AEST 1991


>From the keyboard of simonl at bnr.ca (Simon-Cheuk Leung):
:
:   I have a question on C-shell, if I do the following,
:
:        set item = ( search 'find / -name "\!*" -print' )
:   
:   I can set this item without getting any complain, but it doesn't allow me 
:   echoing $item[2]. How can I echo the original $item[2] in this case? 
:   (include \!*)

You need to either enclose it in double quotes:

    echo "$item[2]"

or turn off globbing with "set noglob" or at least the whining with 
"set nonomatch".  You will lose the backslash, but that's ok.

What's not ok is that you use the csh, which is a royal pain the neck, and
you shouldn't be using it for didly squat.   I know  "should" is a strong
word that we "shouldn't" use, but so be it.  Bill Joy has a plane of hell
reserved all to himself because of the csh.  Use a real shell, or perl, but
break yourself of the csh sickness before it becomes terminal.

--tom



More information about the Comp.unix.shell mailing list