Search Results

Search: Posts Made By: tamil.pamaran
Forum: Programming 10-16-2011
3,556
Posted By agama
The solution isn't straight forward. ...
The solution isn't straight forward.


#define CH(x) #x[0]
#define DECR(a,b,c,d) decr( CH(a), CH(b), CH(c), CH(d) )



The two macros cause the satement

DECR( k, e, y, \0 );

to be...
1,494
Posted By guruprasadpr
awk '{a[$1]+=$2;}END{for (i in a) print i,...
awk '{a[$1]+=$2;}END{for (i in a) print i, a[i];}' file

Guru.
1,494
Posted By Corona688
Why not awk? It can be done in nearly any...
Why not awk? It can be done in nearly any language, of course, but:

1) awk is especially good and efficient for this particular problem
2) everyone has an awk of some sort

Doing the same...
10,971
Posted By ygemici
awk -v a=$start -v b=$end '$0 > a && $0 < b'...
awk -v a=$start -v b=$end '$0 > a && $0 < b' timestamp.log
10,971
Posted By guruprasadpr
Input: $ cat fil 1 4 6 8 10 ...
Input:
$ cat fil
1
4
6
8
10

Output:
$ awk '$0 > 2 && $0 <9' fil
4
6
8


Guru.
2,187
Posted By binlib
All the nawks that I know don't have the mktime...
All the nawks that I know don't have the mktime built-in function. But Corona688's solution works without mktime (just omit mktime and the surrounding parentheses) since the date values are in "yyyy...
10,928
Posted By vino
Can you not have the contents of variable in...
Can you not have the contents of variable in files ?

If then, you can use paste file1 file2
5,290
Posted By thegeek
Your second version processes each line of input...
Your second version processes each line of input one by one, but your first does not !

Because of this line ..

d=`sed 's/[0-9|.]* - [-|a-zA-Z]* \[\([0-9]*\/[a-zA-Z]*\/[0-9:]* [0-9+]*\)\]...
1,173
Posted By clx
Welcome to the forum. You didn't mention...
Welcome to the forum.

You didn't mention about the log file format. If it contains only the IP ADDRESS,
probably you can do something like,

$ cat f5
54.215.211.198
50.215.211.198...
Showing results 1 to 9 of 9

 
All times are GMT -4. The time now is 01:13 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy