Koozali.org: home of the SME Server

Bash Script issue

Offline Alex Schaft

  • ****
  • 97
  • +0/-0
Bash Script issue
« 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
......

Offline Alex Schaft

  • ****
  • 97
  • +0/-0
Bash Script issue
« Reply #1 on: July 06, 2007, 10:01:15 AM »
if [ -n "$CurrentSmartHost" ]

does the trick
......