You are not logged in.

#1 2017-01-27 22:44:36

DCengineer
Member
Registered: 2015-12-11
Posts: 15

Previewing Locale Formats from the Command Line

I would like to look through date and number formats for all of the English locales in Arch Linux and am wondering if there is any easy way to preview the format a locale will use without having to repeatedly change the environment variables and run `date +%x\ %X\ %c`.

  • Does anyone have a suggestion for a good way to do this?

  • After I have chosen the locale I want, how can I delete the generated locales I don't need?

Note: I'm not completely sure if this is the correct form. Perhaps it should go to Newbie Corner, but it seems like more of a general Linux question to me.

Offline

#2 2017-01-28 20:14:36

teckk
Member
Registered: 2013-02-21
Posts: 519

Re: Previewing Locale Formats from the Command Line

Offline

#3 2017-01-28 20:20:02

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 29,517
Website

Re: Previewing Locale Formats from the Command Line

No need to repeatedly set variables and run date ... at least not manually:

#!/bin/bash

awk '/^[^#]/ { print $1; }' /etc/locale.gen | while read locale; do
        LANG="$locale"
        printf "%15s: " $locale
        date +%x\ %X\ %c
done

You may want to set other variables in addition to LANG, just add a line for each one.


"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" -  Richard Stallman

Offline

Board footer

Powered by FluxBB