Hi,
i want to read a text file whose content(single line) will be a number like 1 or 2 or 3 ..... what i want to do is to read the file and increment the content of the file, using unix scripting.
Regards,
Senthil Kumar Siddhan. (2 Replies)
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)
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)
Hi,
from the manual
listen(2): listen for connections on socket - Linux man page
It has a parameter called backlog and it limits the maximum length of queue of pending list.
If I set backlog to 128, is it means no more than 128 packets can be handled by server?
If I have three... (3 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)
Hi,
i want to convert number 5860533159 to hexadecimal. i need to use perl.
i used
$foo = 5860533159;
$hexval3 = sprintf("%#x", $foo);
i am getting value as 0xffffffff.
i need to get value as 0x15D50A3A7. when i converted using google calculator, i got the correct value, expected... (9 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)
Hi,
I have column 5 in a file which contains string like this for ex.
RP11-125O5.2
SLCO1B1
CAPN1
FRMPD2
TXNL4B
So I do by
data = )]
ValueError: invalid literal for int() with base 10: 'R'
Can someday tell me how to convert this column into int successfully.
Thank You in... (7 Replies)
Discussion started by: rossi
7 Replies
LEARN ABOUT ULTRIX
getopt
getopt(3) Library Functions Manual getopt(3)Name
getopt - get option letter from argument vector
Syntax
#include <stdio.h>
int getopt (argc, argv, optstring)
int argc;
char **argv;
char *optstring;
extern char *optarg;
extern int optind, opterr;
Description
The subroutine returns the next option letter in argv that matches a letter in optstring. The optstring is a string of recognized option
letters; if a letter is followed by a colon, the option is expected to have an argument that may or may not be separated from it by white
space. The optarg is set to point to the start of the option argument on return from
The function places in optind the argv index of the next argument to be processed. The external variable optind is automatically initial-
ized to 1 before the first call to
When all options have been processed (that is, up to the first non-option argument), returns EOF. The special option -- may be used to
delimit the end of the options; EOF will be returned, and -- will be skipped.
Diagnostics
The function prints an error message on stderr and returns a question mark (?) when it encounters an option letter that is not included in
optstring. Setting opterr to 0 disables this error message.
Examples
The following code fragment shows how one might process the arguments for a command that can take the mutually exclusive options a and b,
and the options f and o, both of which require arguments:
#include <stdio.h>
main (argc, argv)
int argc;
char **argv;
{
int c;
extern int optind, opterr;
extern char *optarg;
.
.
.
.
while ((c = getopt (argc, argv, "abf:o:")) != EOF)
switch (c) {
case 'a':
if (bflg)
errflg++;
else
aflg++;
break;
case 'b':
if (aflg)
errflg++;
else
bproc( );
break;
case 'f':
ifile = optarg;
break;
case 'o':
ofile = optarg;
bufsiza = 512;
break;
case '?':
errflg++;
}
if (errflg) {
fprintf (stderr, "usage: . . . ");
exit (2);
}
for ( ; optind < argc; optind++) {
if (access (argv[optind], 4)) {
.
.
.
}
See Alsogetopt(1)getopt(3)