From owner-freebsd-bugs@FreeBSD.ORG Mon Dec 22 01:44:22 2003 Return-Path: Delivered-To: freebsd-bugs@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 763BE16A4CE for ; Mon, 22 Dec 2003 01:44:22 -0800 (PST) Received: from tequila.4you.lt (tequila.4you.lt [212.122.68.216]) by mx1.FreeBSD.org (Postfix) with SMTP id 9A2CF43D55 for ; Mon, 22 Dec 2003 01:44:12 -0800 (PST) (envelope-from hugle@vkt.lt) Received: (qmail 56991 invoked by uid 0); 22 Dec 2003 09:40:15 -0000 Received: from hugle@vkt.lt by tequila by uid 82 with qmail-scanner-1.20rc1 (. Clear:RC:1:. Processed in 0.131572 secs); 22 Dec 2003 09:40:15 -0000 Received: from unknown (HELO 127.0.0.1) (213.252.192.162) by tequila.4you.lt with SMTP; 22 Dec 2003 09:40:14 -0000 Date: Mon, 22 Dec 2003 01:43:43 -0800 From: hugle X-Mailer: The Bat! (v2.01) X-Priority: 3 (Normal) Message-ID: <88144631939.20031222014343@vkt.lt> To: freebsd-bugs@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Subject: BASH bug? X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list Reply-To: hugle List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 22 Dec 2003 09:44:22 -0000 Hello all. I have a little problem in here. Actulay i think, that bash doesn't count good, look: cat bin/users | wc -l 1877 so the file contains 1877 lines cat bin/users: #!/bin/sh /sbin/ipfw -q delete 2001 >/dev/null 2>&1 & /sbin/ipfw -q add 2001 count ip from 192.168.0.1 to not me in via fxp0 >/dev/null 2>&1 & /sbin/ipfw -q delete 2002 >/dev/null 2>&1 & /sbin/ipfw -q add 2002 count ip from not me to 192.168.0.1 out via fxp0 >/dev/null 2>&1 & /sbin/ipfw -q delete 2003 >/dev/null 2>&1 & /sbin/ipfw -q add 2003 count ip from 192.168.0.111 to not me in via fxp0 >/dev/null 2>&1 & /sbin/ipfw -q delete 2004 >/dev/null 2>&1 & /sbin/ipfw -q add 2004 count ip from not me to 192.168.0.111 out via fxp0 >/dev/null 2>&1 & ***** **** ***** **** **** **** /sbin/ipfw -q add 2935 count ip from 192.168.5.63 to not me in via fxp0 >/dev/null 2>&1 & /sbin/ipfw -q delete 2936 >/dev/null 2>&1 & /sbin/ipfw -q add 2936 count ip from not me to 192.168.5.63 out via fxp0 >/dev/null 2>&1 & /sbin/ipfw -q delete 2937 >/dev/null 2>&1 & /sbin/ipfw -q add 2937 count ip from 192.168.5.99 to not me in via fxp0 >/dev/null 2>&1 & /sbin/ipfw -q delete 2938 >/dev/null 2>&1 & /sbin/ipfw -q add 2938 count ip from not me to 192.168.5.99 out via fxp0 >/dev/null 2>&1 & so I should have 938 rules in my firewall. 938 * 2=1876 + 1 = 1877 lines in the script (1 rule for delete rule and one for add rule + rule at the top '#!/bin/sh') but when adding this rules to the ipfw ruleset i have: ipfw show 2000-2938 | wc -l 809 so somehere my 938-809=129 rules had just gone somewhere. I'm using bash in here.. could that be a bug in bash ? bash --version GNU bash, version 2.05b.0(1)-release (i386-portbld-freebsd4.9) btw, when i look into ipfw and can't find some rules in it.. for example there goes rule nr 2001,2002,2003,2004,2005,2008 so i have no rule with number 2006 and 2007 but they exist in my script. after running this script other time i got ipfw show 2000-2938 | wc -l 814 one more time : ipfw show 2000-2938 | wc -l 836 But I have not changed anything in my script. ANy ideas? -- Best regards,Hugle