Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 3 Jul 2005 18:29:31 +0200
From:      Roland Smith <rsmith@xs4all.nl>
To:        fbsd_user <fbsd_user@a1poweruser.com>
Cc:        "freebsd-questions@FreeBSD. ORG" <freebsd-questions@freebsd.org>
Subject:   Re: help with sh script
Message-ID:  <20050703162931.GA5598@slackbox.xs4all.nl>
In-Reply-To: <MIEPLLIBMLEEABPDBIEGIEBIHIAA.fbsd_user@a1poweruser.com>
References:  <6BD492A9-2A38-49C8-B0E2-507F1B9964B2@amadeus.demon.nl> <MIEPLLIBMLEEABPDBIEGIEBIHIAA.fbsd_user@a1poweruser.com>

next in thread | previous in thread | raw e-mail | index | archive | help

--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--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20050703162931.GA5598>