(Assuming you use Debian and want the German language)
First you need to make sure the "locales" package is installed:
apt-get install locales
if it is already installed, reconfigure it:
dpkg-reconfigure locales
In either case, the debconf screen appears, where you can select locale files to be generated. Choose at for example "de_DE ISO-8859-1" and leave the default locale to "C" as suggested by debconf.
To test, enter (in bash):
LANG=de_DE date
If it works you can use it in the command line as follows:
Code:
gunzip .... | grep "`LANG=de_DE date +%b`" | sort -g | ....
Or, to use german by default in the current shell, you can "export LANG=de_DE" first and then just use:
Code:
gunzip .... | grep "`date +%b`" | sort -g | ....
If I get your question right, you would like to have the
previous month. Like we are in
may right now, and you'd like to grep for
april. To do that, use:
Code:
LANG=de_DE date -d '1 month ago' +%b
Hope this helps. For more information see "info date" (
not "man date", as the man page does not explain the -d '1 month ago' - like options.