sullise
Verified User
- Joined
- Mar 4, 2004
- Messages
- 475
Ok..sue me, I'm a noob when it comes to shell scripting...help me please!!!
This is a portion of a script I'm working on:
I'm getting these errors:
tempout contains a sorted list of IP's that the loop is supposed to go thru and count and if there are 5 or more of a single IP, output it.
I did an set -x before the top assignments and they are failing as well with "command not found".
I thoroughly confused.
This is a portion of a script I'm working on:
curip = "0.0.0.0"
attempts = 0
cat tempout | \
while read line
do
if [ "$line" != "$curip" ]
then
curip = "$line" <-- line 16
if [ $attempts -gt 4 ] <--- line 17
then
echo $line " was found 5 times"
fi
attempts = 0 <--- line 21
fi
attempts = $attempts + 1 <-- line 23
done
I'm getting these errors:
line 16: curip: command not found
line 17: [: -gt: unary operator expected
line 21: attempts: command not found
line 23: attempts: command not found
tempout contains a sorted list of IP's that the loop is supposed to go thru and count and if there are 5 or more of a single IP, output it.
I did an set -x before the top assignments and they are failing as well with "command not found".
I thoroughly confused.
