02-10-2016
I'd love to - if I only understood what you're after.
The mentioned scriptlet creates a 32-bit binary equivalent of an IP4 address and then XORs it with another. So - analyzing and testing it line by line could help you do what you need.
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
How can I find out, that whether a regular expression are matched or not(as a boolean)?!
tnx in advance. (2 Replies)
Discussion started by: Zaxon
2 Replies
2. Shell Programming and Scripting
Hello all,
I would like to know if it is possible to return a the result of a boolean expression from a function like this
function()
{
# some code
return ||
}
and what will be the return value ?
Thank you for help. (6 Replies)
Discussion started by: dolphin06
6 Replies
3. Shell Programming and Scripting
Hi everybody:
I'm working on a script to send emails with logs attached based on one single rule..."check if the number of errors has increased since the last time the script ran"
Basically what my script does is read from a previous file with the last trace of errors the previous error... (3 Replies)
Discussion started by: hyunkel_01
3 Replies
4. Shell Programming and Scripting
Can someone, please, help me to make this condition valid/accepted in bash?
I really cannot.
I'm stuck with the brackets...
This one tells me: missing `]'
if ]; then
# NOTIFY ERROR...
fi
And... I'd also appreciate a link to bash documents that explain these things. All... (2 Replies)
Discussion started by: mamboknave
2 Replies
5. UNIX for Dummies Questions & Answers
# check host value regex='^(||1|2|25)(\.(||1|2|25)){3}$' if ')" != "" ]; then if ]; then echo host $host not found exit 4 fi elif ]; then echo $host is an invalid host address exit 5 fi
espeacailly the top regex part?
---------- Post updated at 06:58 PM ---------- Previous update was... (1 Reply)
Discussion started by: kevin298
1 Replies
6. Shell Programming and Scripting
# check host value regex='^(||1|2|25)(\.(||1|2|25)){3}$' if ')" != "" ]; then if ]; then echo host $host not found exit 4 fi elif ]; then echo $host is an invalid host address exit 5 fi (1 Reply)
Discussion started by: kevin298
1 Replies
7. Shell Programming and Scripting
hi, im learning python language. and my teacher gives me this question on class:
Boolean expression :
not (p or not q)
what is the correct answer for that? i still dont understand, and please give me a link for a new beginner in python to learn.
thanks (1 Reply)
Discussion started by: jazzyzha
1 Replies
8. Shell Programming and Scripting
Hi,
I am new to shell/bash script. I am trying to run below script
#!/bin/bash
a=0
b=10
if
then
echo "a is equal to be"
else
echo "a is not equal to be"
fi
MAX=10
while
do
echo $a
a='expr $a + 1'
done (1 Reply)
Discussion started by: Mallikgm
1 Replies
9. Shell Programming and Scripting
Hello
I would to write the test on one line like :
declare -i x=0 y=0
........
some code assign value 0 or 1 to x and y
........
# if either x or y or both is set to 1, then do something
if -o ; then
do_something
fi
Any help is welcome (2 Replies)
Discussion started by: jcdole
2 Replies
10. UNIX for Beginners Questions & Answers
I have if loop with multiple variable value check in if loop. How can i print only if loop satisfied variable and its value in shell script ? I dont want to check each variable in if loop. That makes my script larger.
if ]
then
echo "Only satisfied variable with value"
... (3 Replies)
Discussion started by: prince1987
3 Replies
LEARN ABOUT HPUX
net_ntoa
net_aton(3C) net_aton(3C)
NAME
net_aton(), net_ntoa() - network station address string conversion routines
SYNOPSIS
DESCRIPTION
and translate station addresses between hexadecimal, octal or decimal, and binary formats:
converts a hexadecimal, octal, or decimal address to a binary address.
converts a binary address to an
ASCII hexadecimal address.
Both routines are provided in the standard C library and are loaded automatically during compilation.
net_aton Parameters
The following parameters are used by
dstr Pointer to the binary address returned by the function.
sstr Pointer to a null-terminated ASCII form of a station address (Ethernet or IEEE 802.3). This address can be an octal, dec-
imal, or hexadecimal number as used in the C language (in other words, a leading 0x or 0X implies hexadecimal; a leading 0
implies octal; otherwise, the number is interpreted as decimal).
size Length of the binary address to be returned in dstr. The length is 6 for Ethernet/IEEE 802.3 addresses.
net_ntoa Parameters
converts a 48-bit binary station address to its ASCII hexadecimal equivalent. The following parameters are used by
dstr Pointer to the ASCII hexadecimal address returned by the function. dstr is null-terminated and padded with leading zeroes
if necessary. dstr must be at least (2 x size + 3) bytes long to accommodate the size of the converted address.
sstr Pointer to a station address in its binary form.
size Length of sstr.
RETURN VALUE
and return NULL if any error occurs.
EXAMPLES
#include <netio.h>
#define destination_addr "0x00DD0002AD00"
...
struct fis arg;
char str[16];
...
(void) net_aton(arg.value.s, destination_addr, 6);
/* arg.value.s = "<48-bit binary value>" */
(void) net_ntoa(str, arg.value.s, 6);
/* str = "0x00DD0002AD00" */
AUTHOR
was developed by HP.
SEE ALSO
thread_safety(5), lan(7).
net_aton(3C)