Hi All,
I want to convert below Hex value to Dec value in each column .How to do it ? This data is in a 1 file.
4e20 0475
2710 010f
7530 69a2
7530 7e2f
4e20 02dd
7530 6299
4e20 0c0a
7530 69a2
4e20 0a0b
2710 0048
7530 7955
4e20 0d23
7530 622d
7530 9121
2710 001f
7530 7d3f (6 Replies)
i want to convert Hex value To EBCDIC value.
i tried to convert hex to ascii and then to ebcdic but it doesn't give desired results .
it doesn't give corresponding ebcdic value instead it gives some junk values.
e.g;
Hex EBCDIC
-----------------
81 a
82 b
83 c
84 d
85 e
86 f
87... (6 Replies)
Hi,
please tell me how to convert hex number to decimal
000000E7
000000000002640D
0000000000025B16
and seconds to minutes, hours, days, months, years
bytes to kbytes, mbytes , gbytes
read the following examples
while read a b
do
printf "%5d %5d\n" "0x$a" "0x$b"
done < "$FILE"... (15 Replies)
Please Help Me! about the problem down under.
I have 2 files with nearly the same characteristics, I have to convert one to the other format or the other format to one's format. I want to write it with awk.
The first file contain lines like this:
300000001#A#Y#Y#Y#Y
The other file contain... (4 Replies)
Hello,
I woild like to convert hex on KSH not BASH:
I tried to use:
tmp=31
printf "\x"${tmp}""
it works on bash - Output is '1' but not on ksh.
please advice on the right syntax.
Thanks. (4 Replies)
can someone help me in converting hex streams to decimal values using perl script
Hex value:
$my_hex_stream="0c07ac14001676";
Every hex value in the above stream should be converted in to decimal and separated by comma.
The output should be: 12,07,172,20,00,22,118 (2 Replies)
Dear community, I'm going crazy to convert TCP response to HEX using perl. I have a simple connection request where I send data, something like:
use strict;
use IO::Socket;
my $sock;
$sock = new IO::Socket::INET(
PeerAddr => '192.168.10.7',
PeerPort =>... (1 Reply)
When I try to convert big numbers I get extra numbers at the end that doesn't move plus an L character too. How to remove the 4 extra characters at the end 000L?
8b8dbbc584d9c000L
8b8dc4ddd34c6000L
8b8dcdf621bf0000L
8b8dd70e7031a000L
8b8de026bea44000L
#!/usr/bin/python
... (9 Replies)
Discussion started by: bigvito19
9 Replies
LEARN ABOUT DEBIAN
log
PRINTF(9) BSD Kernel Developer's Manual PRINTF(9)NAME
printf, uprintf, tprintf, log -- formatted output conversion
SYNOPSIS
#include <sys/types.h>
#include <sys/systm.h>
int
printf(const char *fmt, ...);
void
tprintf(struct proc *p, int pri, const char *fmt, ...);
int
uprintf(const char *fmt, ...);
#include <sys/syslog.h>
void
log(int pri, const char *fmt, ...);
DESCRIPTION
The printf(9) family of functions are similar to the printf(3) family of functions. The different functions each use a different output
stream. The uprintf() function outputs to the current process' controlling tty, while printf() writes to the console as well as to the log-
ging facility. The tprintf() function outputs to the tty associated with the process p and the logging facility if pri is not -1. The log()
function sends the message to the kernel logging facility, using the log level as indicated by pri.
Each of these related functions use the fmt parameter in the same manner as printf(3). However, printf(9) adds two other conversion speci-
fiers.
The %b identifier expects two arguments: an int and a char *. These are used as a register value and a print mask for decoding bitmasks.
The print mask is made up of two parts: the base and the arguments. The base value is the output base expressed as an integer value; for
example, 10 gives octal and 20 gives hexadecimal. The arguments are made up of a sequence of bit identifiers. Each bit identifier begins
with an integer value which is the number of the bit (starting from 1) this identifier describes. The rest of the identifier is a string of
characters containing the name of the bit. The string is terminated by either the bit number at the start of the next bit identifier or NUL
for the last bit identifier.
The %D identifier is meant to assist in hexdumps. It requires two arguments: a u_char * pointer and a char * string. The memory pointed to
be the pointer is output in hexadecimal one byte at a time. The string is used as a delimiter between individual bytes. If present, a width
directive will specify the number of bytes to display. By default, 16 bytes of data are output.
The log() function uses syslog(3) level values LOG_DEBUG through LOG_EMERG for its pri parameter (mistakenly called 'priority' here). Alter-
natively, if a pri of -1 is given, the message will be appended to the last log message started by a previous call to log(). As these mes-
sages are generated by the kernel itself, the facility will always be LOG_KERN.
RETURN VALUES
The printf() and the uprintf() functions return the number of characters displayed.
EXAMPLES
This example demonstrates the use of the %b and %D conversion specifiers. The function
void
printf_test(void)
{
printf("reg=%b
", 3, "102BITTWO1BITONE
");
printf("out: %4D
", "AAAA", ":");
}
will produce the following output:
reg=3<BITTWO,BITONE>
out: 41:41:41:41
The call
log(LOG_DEBUG, "%s%d: been there.
", sc->sc_name, sc->sc_unit);
will add the appropriate debug message at priority ``kern.debug'' to the system log.
SEE ALSO printf(3), syslog(3)BSD September 8, 2006 BSD