From owner-freebsd-questions@FreeBSD.ORG Sun Jul 3 17:24:02 2005 Return-Path: X-Original-To: freebsd-questions@freebsd.org Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id A8EA916A41C for ; Sun, 3 Jul 2005 17:24:02 +0000 (GMT) (envelope-from FreeBSD@amadeus.demon.nl) Received: from post-22.mail.nl.demon.net (post-22.mail.nl.demon.net [194.159.73.192]) by mx1.FreeBSD.org (Postfix) with ESMTP id 6F4FB43D45 for ; Sun, 3 Jul 2005 17:24:02 +0000 (GMT) (envelope-from FreeBSD@amadeus.demon.nl) Received: from amadeus.demon.nl ([82.161.18.200]:55948 helo=[10.0.1.1]) by post-22.mail.nl.demon.net with esmtp (Exim 4.43) id 1Dp8CH-0000HZ-2C for freebsd-questions@freebsd.org; Sun, 03 Jul 2005 17:24:01 +0000 In-Reply-To: References: Mime-Version: 1.0 (Apple Message framework v730) X-Priority: 3 (Normal) Content-Type: text/plain; charset=US-ASCII; format=flowed Message-Id: <334F6B97-E8F8-448D-B102-FCF0DBFAE474@amadeus.demon.nl> Content-Transfer-Encoding: 7bit From: FreeBSD questions mailing list Date: Sun, 3 Jul 2005 19:23:57 +0200 To: "freebsd-questions@FreeBSD. ORG" X-Mailer: Apple Mail (2.730) Subject: Re: help with sh script X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 Jul 2005 17:24:02 -0000 On 03 jul 2005, at 17:18, fbsd_user wrote: > > > On 03 jul 2005, at 15:39, fbsd_user wrote: > > >>> What is the sh coding to strip the periods from a IP address?? >>> >>> >>> raw_ip='10.0.10.5' this is starting >>> num_ip='100105' and this is what I need to convert to. >>> >>> >>> >>> >> Hi, >> many ways, here's one: >> >> printf '10.0.10.5' | sed 's/\.//g' >> >> Arno >> > > ***************************************** > > Thanks but I need a little more help. > > num_ip="(printf $raw_ip | sed 's/\.//g')" > > gives me a error. > > What would the correct syntax be? > > I am trying to write script to insert rules into PF firewall > on 5.4. using pf anchors. > > > you forgot the " " around the printf argument: num_ip=" `printf "$raw_ip" | sed 's/\.//g' ` " Arno