I am trying to compare to build numbers and echo which is greater. Here is a script i wrote
New_Cycle_Num='c4.10'
Old_Cycle_Num='c4.9'
if [ "$New_Cycle_Num" == "$Old_Cycle_Num" ];
then echo 'both are equal'
elif [ "$New_Cycle_Num" "<" "$Old_Cycle_Num" ]];
then echo 'New_Cycle_Num is less than Old_Cycle_Num'
else echo 'New_Cycle_Num is greater than Old_Cycle_Num'
fi
My script gives me ioutput as 'New_Cycle_Num is less than Old_Cycle_Num" instead of last statement. why is c4.10 compared to be less than c4.9? any help to correct this ?? Many thanks!!