From owner-freebsd-questions Tue Jun 4 5:40:17 2002 Delivered-To: freebsd-questions@freebsd.org Received: from smtp2.mbox.com.au (203-134-146-019.cust.pth.iprimus.net.au [203.134.146.19]) by hub.freebsd.org (Postfix) with ESMTP id EBD4737B406 for ; Tue, 4 Jun 2002 05:40:07 -0700 (PDT) Received: from nms2.mbox.com.au (webmail.mbox.com.au [192.168.20.4]) by smtp2.mbox.com.au (Sun Internet Mail Server sims.4.0.2000.05.17.04.13.p6) with ESMTP id <0GX6001RGLM3BA@smtp2.mbox.com.au> for freebsd-questions@FreeBSD.ORG; Tue, 4 Jun 2002 20:34:51 +0800 (WST) Received: from mbox.com.au ([127.0.0.1]) by nms2.mbox.com.au (Netscape Messaging Server 4.15) with ESMTP id GX6LP501.DY5 for ; Tue, 04 Jun 2002 20:36:41 +0800 Date: Tue, 04 Jun 2002 22:36:41 +1000 From: BSD Freak Subject: Getting network and broadcast addresses in a shell script To: FreeBSD Questions Message-id: MIME-version: 1.0 X-Mailer: Netscape Webmail Content-type: text/plain; charset=us-ascii Content-language: en Content-disposition: inline Content-transfer-encoding: 7BIT X-Accept-Language: en Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG Hi all, I have the following shell script I am writing in which I need to get the $network and $broadcast: #!/bin netmask=255.255.255.0 ip=192.168.0.1 network=`do some magic with $netmask and $ip` broadcast=`do some more magic with $netmask and $ip` echo $network echo $broadcast Can anyone help me with the magic? --------------------------------------------------------------------- Faxes delivered directly to any email address, new to mBox! Find out more http://www.mbox.com.au/fax To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message