簡體   English   中英

如何在用戶使用 Shell Scripting 輸入的日期之后打印月中的第幾天(星期一,星期二)?

[英]how to print the day of the month(mon,tue) after the date entered by user using Shell Scripting?

這不起作用

echo " ENter Day Month Year "
read day
read month
read year
cal $month $year
echo "`date --date '$year-$month-$day' +%A`"

但是,這有效

date --date '2018-11-02' +%A
date --date "$year-$month-$day" +%A

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM