
ksh conditional (string match pattern)
Hi,
I want to set up my .profile to use different environment variables
based on machine name. I currently do this with a case statement, ie
MACHINE=`uname -n`
case $MACHINE in
machine1|machine2) export VAR=/onepath;;
other) export VAR=/different/path;;
esac
but looking in my Unix in a Nutshell (shameless plug for a great book)
I see that ksh should support the followign conditional test
if [ "$MACHINE" = "machine?" ]
then
export VAR=/onepath
else
export VAR=/different/path
fi
This doesn't seem to work for me though - am I missing something here?
I have tried [[]], and also * instead of ? and still don't get the
desired result.
Any help greatly appreciated
Matt Proctor
m...@lyveden.demon.co.uk