help with sh script

Roland Smith rsmith at xs4all.nl
Sun Jul 3 16:29:36 GMT 2005


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

Use backtics:

num_ip=`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
-- 
R.F.Smith (http://www.xs4all.nl/~rsmith/) Please send e-mail as plain text.
public key: http://www.xs4all.nl/~rsmith/pubkey.txt
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 187 bytes
Desc: not available
Url : http://lists.freebsd.org/pipermail/freebsd-questions/attachments/20050703/461d625e/attachment.bin


More information about the freebsd-questions mailing list