$<

Dave Hiebeler hiebeler at rpics
Thu Nov 10 13:58:45 AEST 1988


In article <1698 at imagine.PAWL.RPI.EDU> tale at pawl.rpi.edu writes:
>Okay, here's a segment of code that doesn't do exactly what everyone things
>it should.  It's for an csh-script.
> 
>set page = $<
>echo $page $#page		/* just for debugging
>if ( $page == 'q' ) exit
>man $page | less
>
>If I give it '5 plot', it does:
>5 plot 1
>if: expression syntax
>child of tty exited with return code 1
> 
  I think you want your third line to read:
if ( ${page[1]} == "q" ) exit

  (Note that just out of habit I use {} around variable-names, and double
quotes around strings... you probably don't need them, but I'm not sure.)
  I think your problem was the if was getting expanded to:
    if ( 5 plot == 'q' ) exit
----
Dave Hiebeler      Internet: hiebeler at cs.rpi.edu  (preferred address)
R.D. Box 225A                userfrzk%mts at itsgw.rpi.edu
Chatham, NY 12037    Bitnet: userfrzk at rpitsmts.bitnet
  "xue zai xao"     "...I can't remember what I was going to say..."



More information about the Comp.unix.questions mailing list