我有代碼匹配:Bash ||在if []中;塊
if [ $LAST_MODIFIED -lt 3600 || ! -f "$i" ]; then
wget $WGET_OPTS $BASE$i
LAST_MODIFIED=`echo "\`date +%s\` - \`stat -c %Y $i\`" | bc`
if [ $LAST_MODIFIED -lt 500 ]; then
$FILES_MODIFIED++
fi
fi
$i
經由
for i in `/bin/grep ".gz" index.html | awk -F\" '{print $2}'`
然而定義時,bash告訴我
[: missing `]'
和
-f: command not found
爲什麼?
如果您感興趣,[通常是'test'命令的符號鏈接。所以你可以做一個測試的人。 – ssteidl 2009-12-11 20:48:35