Koozali.org: home of the SME Server

Contribs.org Forums => General Discussion => Topic started by: Alex Schaft on July 06, 2007, 09:33:55 AM

Title: Bash Script issue
Post by: Alex Schaft on July 06, 2007, 09:33:55 AM
Hi,

Hope someone can help me out

Code: [Select]

CurrentSmartHost=`config show SMTPSmartHost | cut -f2 -d'='`
config show SMTPSmartHost
if [ -n $CurrentSmartHost ] ; then
  echo Smart Host Set
else
  echo Smart Host not set
fi


With SMTPSmartHost not set, the -n test keeps coming back true...

Can someone tell me why?

Thanks,
Alex
Title: Bash Script issue
Post by: Alex Schaft on July 06, 2007, 10:01:15 AM
if [ -n "$CurrentSmartHost" ]

does the trick