Timeline for How to get current month name in bash script
Current License: CC BY-SA 3.0
4 events
| when toggle format | what | by | license | comment | |
|---|---|---|---|---|---|
| Dec 11, 2019 at 7:49 | comment | added | Stéphane Chazelas | @computingfreak, that should rather be currentmonthname=$(LC_ALL=C date +%B). Your approach would only work if $LANG was already in the environment and LC_ALL was not set and either en_us_88591 is an existing locale on your system with US English month names or (more likely) it doesn't exist in which case it would default to the C/POSIX locale where month names are in English. | |
| Jan 9, 2019 at 8:42 | comment | added | computingfreak | the output is locale-specific. for example, this will return "1月" if your system locale is set to Japanese, use currentmonthname=$(LANG=en_us_88591; date "+%B"); to get English month name | |
| Jan 31, 2017 at 8:34 | vote | accept | Hiraman Patil | ||
| Jan 31, 2017 at 7:51 | history | answered | Bigon | CC BY-SA 3.0 |