shell vs csh

Richard John Botting rbottin at atl.calstate.edu
Wed Mar 28 03:23:57 AEST 1990


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 at atl.calstate.edu
>INTERNET:rbottin at atl.calstate.edu (Compuserve)
paaaaar at calstate.bitnet 



More information about the Comp.unix.questions mailing list