我在bash中有一个脚本,从第8列的LocLog中获取ip:
#!/bin/bash
for i in $(cat /scripts/logs/LocLog | awk '{print $8}' | sort | uniq);
do
php /scripts/a.php $i;
done
脚本出错:
bash -x log
'og: line 2: syntax error near unexpected token `
'og: line 2: `for i in $(cat /scripts/logs/LocLog | awk '{print $8}' | sort | uniq);
有什么想法吗?
答案 0 :(得分:2)
摆脱for
行末尾的分号。