I have a short script:
#!/bin/bash
while read LINE
do
whois $LINE | grep 'abuse' /dev/null
if $? != 0; then
echo $LINE noabuse.txt
fi
done iplist
I'm getting command not found on the if line. Have I not formatted it
correctly? The script is supposed to append $LINE to a file
I have a short script:
#!/bin/bash
while read LINE
do
whois $LINE | grep 'abuse' /dev/null
if $? != 0; then
echo $LINE noabuse.txt
fi
done iplist
I'm getting command not found on the if line. Have I not formatted it
correctly? The script is supposed to append
On Thu, 2006-10-12 at 13:49 -0700, Richard Broersma Jr wrote:
I have a short script:
#!/bin/bash
while read LINE
do
whois $LINE | grep 'abuse' /dev/null
if $? != 0; then
echo $LINE noabuse.txt
fi
done iplist
I'm getting command not found on the if
On Thu, 12 Oct 2006 15:41:12 -0500, Michael Sullivan wrote:
while read LINE
do
whois $LINE | grep 'abuse' /dev/null
if $? != 0; then
echo $LINE noabuse.txt
fi
done iplist
I'm getting command not found on the if line.
The if line should be if [ $? -ne 0 ]; then
Or you
OK. Here's my new code:
#!/bin/bash
while read LINE
do
whois $LINE | grep 'abuse' /dev/null
if [$? -ne 0]; then
echo $LINE noabuse.txt
fi
done iplist
Here's the output:
[EMAIL PROTECTED] ~/.maildir/.SPAM/cur $ ./process.sh
./process.sh: line 6: [1: command
Surround the [ and ] with spaces.
On Thursday October 12 2006 17:08, Michael Sullivan wrote:
On Thu, 2006-10-12 at 13:49 -0700, Richard Broersma Jr wrote:
I have a short script:
#!/bin/bash
while read LINE
do
whois $LINE | grep 'abuse' /dev/null
if $? != 0; then
On Thursday 12 October 2006 23:08, Michael Sullivan wrote:
[SNIP]
OK. Here's my new code:
[SNIP]
Maybe you should have a look at:
http://devmanual.gentoo.org/tools-reference/bash/index.html
--
Bo Andresen
pgpxpDTTnsL1r.pgp
Description: PGP signature
Selon Michael Sullivan [EMAIL PROTECTED]:
#!/bin/bash
while read LINE
do
whois $LINE | grep 'abuse' /dev/null
if [$? -ne 0]; then
echo $LINE noabuse.txt
fi
done iplist
Here's the output:
[EMAIL PROTECTED] ~/.maildir/.SPAM/cur $ ./process.sh
./process.sh: line 6:
8 matches
Mail list logo