0

I have a script in bash what take from LocLog a ip from collumn 8 :

#!/bin/bash
for i in $(cat /scripts/logs/LocLog | awk '{print $8}' | sort | uniq); 
do 
    php /scripts/a.php $i; 
done

The script give an error:

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);

Any ideeas?

1
  • Useless use of cat (and probably uniq): awk '{print $8}' /scripts/logs/LocLog | sort -u Commented Oct 3, 2013 at 11:27

1 Answer 1

2

Get rid of the semicolon at the end of the for line.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.