[comp.unix.questions] shell vs csh

rbottin@atl.calstate.edu (Richard John Botting) (03/28/90)

Dahe Chen
 Asked
>I am having trouble with a shell script I wrote (forgive me if it is trivial
,
>what can you blame for a naive user):
[...]
>MANPATH=/twolf7/dchen/man
>if [ -f $MANPATH/"$1".1 ]
>then
>does not work when I do
>% man xxx
>which gives me
>No manual entry for .

Looks like a feature of 'sh' that regularly trips me  up.

Try inserting "; export MANPATH" after "MANPATH=/twolf7/dchen/man"

If that makes it weork the explanation is:
	'sh'  doesn't hand on variables to a subthing
	unless you tell it to with an
	export command...
	PLUS
	'[ -f $MANPATH/"$1".1 ]' is actually 'test -f $MANPATH/"$1".1'



Dick Botting, 
Department of computer science,
California State University, San Bernardino, CA 92407

rbottin@atl.calstate.edu
>INTERNET:rbottin@atl.calstate.edu (Compuserve)
paaaaar@calstate.bitnet