24 lines
826 B
Bash
24 lines
826 B
Bash
|
# Get the current date in Japanese-style format without the day
|
||
|
japanese_date=$(date '+%Y年%m月%d日')
|
||
|
|
||
|
# Get the current day of the week in English
|
||
|
english_day=$(date '+%A')
|
||
|
|
||
|
# Convert English day name to Japanese day name
|
||
|
case $english_day in
|
||
|
Monday) japanese_day="月曜日" ;;
|
||
|
Tuesday) japanese_day="火曜日" ;;
|
||
|
Wednesday) japanese_day="水曜日" ;;
|
||
|
Thursday) japanese_day="木曜日" ;;
|
||
|
Friday) japanese_day="金曜日" ;;
|
||
|
Saturday) japanese_day="土曜日" ;;
|
||
|
Sunday) japanese_day="日曜日" ;;
|
||
|
*) japanese_day="Unknown" ;; # Handle unexpected values
|
||
|
esac
|
||
|
|
||
|
# Combine the Japanese-style date with the Japanese day name, adding spaces
|
||
|
japanese_date_with_day=" $japanese_date $japanese_day"
|
||
|
|
||
|
# Output the formatted date and day in Japanese
|
||
|
echo "📅 $japanese_date_with_day "
|