I have a signal file which contains Distance information(DIST). Based on DIST value I want to execute program commands on signal file. I have tried if statement but unable to get over it.
for i in *sac
do
DST=`saclhdr -DIST $i`
if [ "$DST" <= "5000" ] ; then
gsac << EOF
cut b b 1200
r $i
w append .cut
quit
EOF
fi
done
In the above code say DST=3313.7, If it is less-then or equal to 5000 then perform given commands, if condition not satisfied then don't perform given commands.