Search Results

Search: Posts Made By: tamil.pamaran
Forum: Programming 10-16-2011
3,444
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,416
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,647
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,647
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.
1,416
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.
5,156
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+]*\)\]...
2,127
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...
1,116
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...
10,628
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
Showing results 1 to 9 of 9

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