I'm having difficulty with the following script: SYNHOST=caalt04
if echo `ping -c 1 $SYNHOST` | grep -q "1 received"; then echo 'Synergy connected'; ssh -2 -f -N -L 24800:$SYNHOST:24800 [EMAIL PROTECTED]; synergyc localhost; else echo 'Synergy NOT connected'; fi I'm getting the error that "then" is not being found. This script was working before I pulled caalt04 out as a variable. But I "tidied" up things at the same time, so may have messed it up somewhere else. Background: I learn languages by pinching other people's code. This is based on some stuff I pinched from someone and I sometime leave options in that don't need to be there. Any help appreciated.