From owner-freebsd-questions@FreeBSD.ORG Sun Jul 3 16:29:35 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 ECC1316A41C for ; Sun, 3 Jul 2005 16:29:35 +0000 (GMT) (envelope-from rsmith@xs4all.nl) Received: from smtp-vbr10.xs4all.nl (smtp-vbr10.xs4all.nl [194.109.24.30]) by mx1.FreeBSD.org (Postfix) with ESMTP id 81DDF43D46 for ; Sun, 3 Jul 2005 16:29:35 +0000 (GMT) (envelope-from rsmith@xs4all.nl) Received: from slackbox.xs4all.nl (slackbox.xs4all.nl [213.84.242.160]) by smtp-vbr10.xs4all.nl (8.13.3/8.13.3) with ESMTP id j63GTWoI077387; Sun, 3 Jul 2005 18:29:32 +0200 (CEST) (envelope-from rsmith@xs4all.nl) Received: by slackbox.xs4all.nl (Postfix, from userid 1001) id ED75E6259; Sun, 3 Jul 2005 18:29:31 +0200 (CEST) Date: Sun, 3 Jul 2005 18:29:31 +0200 From: Roland Smith To: fbsd_user Message-ID: <20050703162931.GA5598@slackbox.xs4all.nl> Mail-Followup-To: fbsd_user , "freebsd-questions@FreeBSD. ORG" References: <6BD492A9-2A38-49C8-B0E2-507F1B9964B2@amadeus.demon.nl> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="3V7upXqbjpZ4EhLz" Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.4.2.1i X-GPG-Fingerprint: 1A2B 477F 9970 BA3C 2914 B7CE 1277 EFB0 C321 A725 X-GPG-Key: http://www.xs4all.nl/~rsmith/pubkey.txt X-GPG-Notice: If this message is not signed, don't assume I sent it! X-Virus-Scanned: by XS4ALL Virus Scanner Cc: "freebsd-questions@FreeBSD. ORG" 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 16:29:36 -0000 --3V7upXqbjpZ4EhLz Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sun, Jul 03, 2005 at 12:14:05PM -0400, fbsd_user wrote: > >many ways, here's one: > > > >printf '10.0.10.5' | sed 's/\.//g' > > > >Arno >=20 > ***************************************** >=20 > Thanks but I need a little more help. >=20 > num_ip=3D"(printf $raw_ip | sed 's/\.//g')" >=20 > gives me a error. >=20 > What would the correct syntax be? Use backtics: num_ip=3D`echo $raw_ip | sed 's/\.//g'` Note that when you do this, more that one IP address can end up as the same num_ip, e.g. 11.0.1.50 and 1.10.1.50. Roland --=20 R.F.Smith (http://www.xs4all.nl/~rsmith/) Please send e-mail as plain text. public key: http://www.xs4all.nl/~rsmith/pubkey.txt --3V7upXqbjpZ4EhLz Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.1 (FreeBSD) iD8DBQFCyBJrEnfvsMMhpyURAnETAJ9TSHjVbMa/Aspl7AcywPr87aE0DgCgjIgf umkfb9BrKExkKZZl7drSb1k= =/g4K -----END PGP SIGNATURE----- --3V7upXqbjpZ4EhLz--