0403-057 Syntax error for if statement

view story

http://www.unix.com – I am getting the following error when I am running a script in ksh when trying to execute an if statement comparing two numerical values tstmb.sh[26]: 1.5321e+08: 0403-057 Syntax error Below is my code snippet. Code: #!/bin/ksh set -x TODAY=$(date +%y%m%d) for file in $(ls -rt  *.log | tail -1) do V=$file V1=${V#*_} V2=${V1%%_*} if [ "$V2" -ne "$TODAY" ]; then echo "abc" elif <condition> then echo "xyz" else echo "123" fi done TODAY=130830 + V=ABC_130830_001.log + V1=130830_000004.log (HowTos)