I have an output of one month:
Agosto
I want to convert it to whole:
08
In linux Bash, I have the following code ... But it does not work, since it gives me jumps of the line with each converted element:
com2=$(cut -d/ -f2,2 tmp_date.log | sed -n '1p')
print "$com2" > tmp_date2.log
if [[ "$com2" = "December" ]] then month=12
elif [[ "$com2" = "November" ]] then month=11
elif [[ "$com2" = "October" ]] then month=10
elif [[ "$com2" = "September" ]] then month=09
elif [[ "$com2" = "August" ]] then month=08
elif [[ "$com2" = "July" ]] then month=07
elif [[ "$com2" = "June" ]] then month=06
elif [[ "$com2" = "May" ]] then month=05
elif [[ "$com2" = "April" ]] then month=04
elif [[ "$com2" = "March" ]] then monnth=03
elif [[ "$com2" = "February" ]] then month=02
elif [[ "$com2" = "January" ]] then month=01
fi
echo ${month}
There is some other way to make it more efficient.