Hi!
I am running this script, that sets the begining and end of a period:
Code:
#!/bin/bash
MES=`head -n 1 /home/jm/Dropbox/par/mes`
YR=`head -n 1 /home/jm/Dropbox/par/yr`
MES_NUM=`date +"%m"`
MES_TXT=`date -d "$YR-$MES-01" +%^b`
HOY=`date +"%d-%^b-%Y"`
INI=`date +"01-$MES_TXT-$YR"`
ULT=`echo $(cal $MES $YR) | awk '{print $NF}'`
if [ "$MES" = "$MES_NUM" ]
then FIN=$HOY
else FIN=`date +"$ULT-$MES_TXT-$YR"`
fi
echo $INI > /home/jm/sh/mysql/ini
echo $FIN > /home/jm/sh/mysql/fin
If I run it by myself, the variables INI and FIN are created in spanish, which I need, eg 01-ABR-2011.
But, when I run the script through crontab (obviously with the same user), the output is created in english!, eg 01-APR-2011.
My locale are set as follows,
Code:
LANG=es_ES.UTF-8
LC_CTYPE="es_ES.UTF-8"
LC_NUMERIC="es_ES.UTF-8"
LC_TIME="es_ES.UTF-8"
LC_COLLATE="es_ES.UTF-8"
LC_MONETARY="es_ES.UTF-8"
LC_MESSAGES="es_ES.UTF-8"
LC_PAPER="es_ES.UTF-8"
LC_NAME="es_ES.UTF-8"
LC_ADDRESS="es_ES.UTF-8"
LC_TELEPHONE="es_ES.UTF-8"
LC_MEASUREMENT="es_ES.UTF-8"
LC_IDENTIFICATION="es_ES.UTF-8"
LC_ALL=
Is there anything I am missing?
Thanks!