RE: alternative way of addressing

From: Eric Polin (sideone@netwolves.com)
Date: 01/30/02


From: "Eric Polin" <sideone@netwolves.com>
To: <security-basics@securityfocus.com>
Date: Wed, 30 Jan 2002 11:28:27 -0500

i couldnt get this program to compile, so i wrote a quick sh script to do
the same thing.

!/bin/sh
# change your ip to DWORD
# another quickie by eric polin.. sideone@netwolves.com

echo "what is your ip address? "
   read OC1

IP1=`echo $OC1 | awk -F. '{print $1}'`
IP2=`echo $OC1 | awk -F. '{print $2}'`
IP3=`echo $OC1 | awk -F. '{print $3}'`
IP4=`echo $OC1 | awk -F. '{print $4}'`

echo -e "your ip address in dword is: \c"
  expr \( \( \( \( \( $IP1 \* 256 + $IP2 \) \* 256 \) + $IP3 \) \* 256 \) +
$IP4 \)

enjoy,

eric polin

--- Jean-Frangois_Asselin <jfasselin@micrologic.ca>
wrote:
> http://www.pc-help.org/obscure.htm
>

  Using info from above URL i wrote a small program
that will do conversion from decimal to IP and back

http://nocon.darkflame.net/files/ip2d.c

-NC

__________________________________________________
Do You Yahoo!?
Great stuff seeking new owners in Yahoo! Auctions!
http://auctions.yahoo.com



Relevant Pages

  • Re: Combining variables
    ... If I have three parameters in a script thus: ... and I now build a for loop to echo the values ... parameter PARM10, how would I do that by combining my AZ parameter. ... Do you Yahoo!? ...
    (AIX-L)
  • Re: Combining variables
    ... Subject: Combining variables ... If I have three parameters in a script thus: ... and I now build a for loop to echo the values ... Do you Yahoo!? ...
    (AIX-L)
  • Re: Combining variables
    ... If I have three parameters in a script thus: ... and I now build a for loop to echo the values ... parameter PARM10, how would I do that by combining my AZ parameter. ... Do you Yahoo!? ...
    (AIX-L)
  • Re: I worked to make my shell but that is very slow. Can I more fast that?
    ... i know this is a shell group but you could also use perl... ... in mind this script is only designed to work with one 'word' per line. ... echo "Making......." ...
    (comp.unix.shell)
  • Re: Combining variables
    ... If I have three parameters in a script thus: ... and I now build a for loop to echo the values ... parameter PARM10, how would I do that by combining my AZ parameter. ... Do you Yahoo!? ...
    (AIX-L)