Hi,
Thanks for your explanation. If I understand it right, suppose we have a file as shown below:
Here hi comes 3 times.
First time when hi comes, x[hi] will be initialized to 0, which is negated and so it becomes 1 and the line is printed. Second time, x[hi] will be 1, which gets negated and so it becomes 0 and the line is not printed.
If I am not wrong, third time, x[hi] will be 0, which gets negated to 1 and the line should be printed. I think there is something I am missing here. Please clarify.
I am doing KSH script to remove duplicate lines in a file. Let say the file has format below.
FileA
1253-6856
3101-4011
1827-1356
1822-1157
1822-1157
1000-1410
1000-1410
1822-1231
1822-1231
3101-4011
1822-1157
1822-1231
and I want to simply it with no duplicate line as file... (5 Replies)
I have following file content (3 fields each line):
23 888 10.0.0.1
dfh 787 10.0.0.2
dssf dgfas 10.0.0.3
dsgas dg 10.0.0.4
df dasa 10.0.0.5
df dag 10.0.0.5
dfd dfdas 10.0.0.5
dfd dfd 10.0.0.6
daf nfd 10.0.0.6
...
as can be seen, that the third field is ip address and sorted. but... (3 Replies)
I have a log file "logreport" that contains several lines as seen below:
04:20:00 /usr/lib/snmp/snmpdx: Agent snmpd appeared dead but responded to ping
06:38:08 /usr/lib/snmp/snmpdx: Agent snmpd appeared dead but responded to ping
07:11:05 /usr/lib/snmp/snmpdx: Agent snmpd appeared dead but... (18 Replies)
Hi, I have a huge file which is about 50GB. There are many lines. The file format likes
21 rs885550 0 9887804 C C T C C C C C C C
21 rs210498 0 9928860 0 0 C C 0 0 0 0 0 0
21 rs303304 0 9941889 A A A A A A A A A A
22 rs303304 0 9941890 0 A A A A A A A A A
The question is that there are a few... (4 Replies)
Hello again, I am wanting to remove all duplicate blocks of XML code in a file. This is an example:
input:
<string-array name="threeItems">
<item>item1</item>
<item>item2</item>
<item>item3</item>
</string-array>
<string-array name="twoItems">
<item>item1</item>
<item>item2</item>... (19 Replies)
Hi,
I am on a Solaris8 machine
If someone can help me with adjusting this awk 1 liner (turning it into a real awkscript) to get by this "event not found error"
...or
Present Perl solution code that works for Perl5.8 in the csh shell ...that would be great.
******************
... (3 Replies)
Hi All,
I am storing the result in the variable result_text using the below code.
result_text=$(printf "$result_text\t\n$name") The result_text is having the below text. Which is having duplicate lines.
file and time for the interval 03:30 - 03:45
file and time for the interval 03:30 - 03:45 ... (4 Replies)
I create a CGI in bash/html.
My awk script looks like :
echo "<table>"
for fn in /var/www/cgi-bin/LPAR_MAP/*;
do
echo "<td>"
echo "<PRE>"
awk -F',|;' -v test="$test" '
NR==1 {
split(FILENAME ,a,"");
}
$0 ~ test {
if(!header++){
... (12 Replies)
Discussion started by: Tim2424
12 Replies
LEARN ABOUT DEBIAN
explain_time_or_die
explain_time_or_die(3) Library Functions Manual explain_time_or_die(3)NAME
explain_time_or_die - get time in seconds and report errors
SYNOPSIS
#include <libexplain/time.h>
time_t explain_time_or_die(time_t *t);
time_t explain_time_on_error(time_t *t);
DESCRIPTION
The explain_time_or_die function is used to call the time(2) system call. On failure an explanation will be printed to stderr, obtained
from the explain_time(3) function, and then the process terminates by calling exit(EXIT_FAILURE).
The explain_time_on_error function is used to call the time(2) system call. On failure an explanation will be printed to stderr, obtained
from the explain_time(3) function, but still returns to the caller.
t The t, exactly as to be passed to the time(2) system call.
RETURN VALUE
The explain_time_or_die function only returns on success, see time(2) for more information. On failure, prints an explanation and exits, it
does not return.
The explain_time_on_error function always returns the value return by the wrapped time(2) system call.
EXAMPLE
The explain_time_or_die function is intended to be used in a fashion similar to the following example:
time_t result = explain_time_or_die(t);
SEE ALSO time(2) get time in seconds
explain_time(3)
explain time(2) errors
exit(2) terminate the calling process
COPYRIGHT
libexplain version 0.52
Copyright (C) 2009 Peter Miller
explain_time_or_die(3)