Gentoo Archives: gentoo-user

From: Michael Sullivan <michael@××××××××××××.com>
To: gentoo-user <gentoo-user@l.g.o>
Subject: [gentoo-user] OT - Question about conditionals and bash scripting
Date: Thu, 12 Oct 2006 20:46:26
Message-Id: 1160685672.12702.16.camel@camille.gateway.2wire.net
1 I have a short script:
2
3 #!/bin/bash
4
5 while read LINE
6 do
7 whois $LINE | grep 'abuse' &> /dev/null
8 if $? != 0; then
9 echo "$LINE" >> noabuse.txt
10 fi
11 done < iplist
12
13 I'm getting "command not found" on the if line. Have I not formatted it
14 correctly? The script is supposed to append $LINE to a file if the
15 return code of whois $LINE | grep 'abuse' returns false (not 0)...
16
17 --
18 gentoo-user@g.o mailing list

Replies

Subject Author
Re: [gentoo-user] OT - Question about conditionals and bash scripting Richard Broersma Jr <rabroersma@×××××.com>
Re: [gentoo-user] OT - Question about conditionals and bash scripting Neil Bothwick <neil@××××××××××.uk>