$<

Dave Dave
Thu Nov 10 09:31:44 AEST 1988


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 'plot' (no quotes, though), it does:
plot 1
[ plot manpage ]

If I give it 'q', it does:
q 1
[ clean exit ]

If I give it '5 plot', it does:
5 plot 1
if: expression syntax
child of tty exited with return code 1

If I take out the if statement, it still looks up the manpage for plot
as advertised, doesn't find one for q, as expected, and does:
5 plot 1
No manual page for 5 plot

Note that the last results are also gained by man $< | less and an
input of '5 plot'.

Now here's the rub.  'man 5 plot' typed in csh DOES provide the
requested manpage of plot(5).  So it does exist.

Right now I have a UI kludge written to compensate for this apparent
bug, but I would rather not have it.  I just want to be able to
type the manpage I want rather than tell it I need another section,
then type the section and then type the page, or even start off
with a case statement saying for a single number entered then branch
to ask for the page from that section.

Can someone please explain to me why this behave as it does and suggest
a fix?  Any help would be appreciated.

AtDhVaAnNkCsE

Dave
--
                   g l o r i o u sex i s t e n c e
EMAIL: tale at rpitsmts.bitnet, tale%mts.rpi.edu at rpitsgw, tale at pawl.rpi.edu
#! rnews           1118
Path: psuvm.bitn



More information about the Comp.unix.questions mailing list