Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我无法传递我$daysSeconds的GAWK表达式没有正确评估
$daysSeconds
GAWK
#___________ days=20 daysSeconds=$(expr $days \* 86400) DAY=`gawk 'BEGIN{print strftime("%d", systime() - $daysSeconds )}'` echo $DAY #____
不确定您要做什么。 %d The day of the month as a decimal number (01–31).
%d The day of the month as a decimal number (01–31).
你不应该混合括号$()和后面的抽动。使用括号。 您不应该直接在 awk 中使用变量。 像这样开始阻止似乎是一个问题:
$()
DAY=$(echo "$daysSeconds" | awk '{print strftime("%d",systime()-$1)}')
为18_$DAY
18
$DAY