【发布时间】:2013-12-03 05:02:10
【问题描述】:
在 bash 脚本中,我定义了一个数组:
array=$(awk '{print $4}' /var/log/httpd/sample | uniq -c | cut -d[ -f1)
现在,我想将此内容翻译成 bash 脚本中的代码:
"如果数组中没有任何元素,则表示array=nothing,则echo "nothing in array"。
帮我做那件事???非常感谢
*此外,我想每隔 5 分钟定期删除 access_log 的内容(/var/log/httpd/access_log)。请告诉我该怎么做??*
【问题讨论】: