Date: Sun, 3 Jul 2005 22:56:15 +0300 From: Giorgos Keramidas <keramida@ceid.upatras.gr> To: fbsd_user <fbsd_user@a1poweruser.com> Cc: freebsd-questions@freebsd.org Subject: Re: help with sh script Message-ID: <20050703195615.GA43273@gothmog.gr> In-Reply-To: <MIEPLLIBMLEEABPDBIEGOEBEHIAA.fbsd_user@a1poweruser.com> References: <MIEPLLIBMLEEABPDBIEGOEBEHIAA.fbsd_user@a1poweruser.com>
index | next in thread | previous in thread | raw e-mail
On 2005-07-03 09:39, fbsd_user <fbsd_user@a1poweruser.com> 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.
There are many ways:
echo "${raw_ip}" | sed -e 's/\.//g'
echo "${raw_ip}" | perl -pe 's/\.//g'
echo "${raw_ip}" | awk -F. '{gsub("\\.", ""); print}'
help
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20050703195615.GA43273>
