Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!usc!cs.utexas.edu!uunet!fibercom!rrg From: rrg@fibercom.COM (Rhonda Gaines) Newsgroups: comp.unix.questions Subject: sh script question Message-ID: <16387@fibercom.COM> Date: 11 Apr 91 13:38:11 GMT Reply-To: rrg@fibercom.COM (Rhonda Gaines) Organization: FiberCom Inc., Roanoke, Virginia Lines: 48 I am trying to edit the following script to check if a man page has been compressed and if so to pipe it through zcat first and then eroff it. The problem is that sh is not recognizing the *.Z as a wildcard. Any ideas? I'm pretty new at this so any help will be appreciated. -rhonda #! /bin/sh # # Usage: lpman [section] # # Print hardcopy of online manual pages for in [section]. # If section is not given, print all instances of found. # If is a string enclosed with double-quotes, any wildcard # characters will be expanded as the search for man pages is made # (e.g. 'lpman "init*"' will print all instances of man pages starting # with the string "init"). # # $1 = manual entry # $2 = section number FILES=`find /usr/man/man*$2* -name "$1.*" -print` if test "$FILES" = "" ; then echo -n "No manual entry for $1" if test "$2" = "" ; then : else echo -n " in section ($2)" fi echo else if test "$FILES" = "*.Z" ; then echo -n "$1 is compressed, piping output through zcat" /usr/ucb/zcat $FILES|/usr/local/bin/eroff -man $FILES else /usr/local/bin/eroff -man $FILES echo -n "Manual page for $1" fi if test "$2" = "" ; then : else echo -n " ($2)" fi echo " sent to LaserWriter" fi