Hi all,
I have set up a simple awk script to calculate the average of values that are printed out a number of times per second (the number of time the printing occurs varies). The data is of the format shown below:
1 4.43
1 3.65
1 2.45
2 7.65
2 8.23
2 5.65
3 4.65
3 6.21
.. ..
120... (4 Replies)
Hi
New to shell script and awk and need assistance on this problem. I need to use a variable to substitute a string in an external file and write the changed info to another file.
At first I did not know if you could use a variable as the sub value but the following showed me that I can.
... (3 Replies)
Hi
There is one problem which i am not able to find the solution :(
Suppose there are two files tmpfile1 and tmpfile2 .
tmpfile1 contains data as
:bash> cat tempfile1
1222
1234
1234
1234
:bash>
now my code is written as
getcommand="cat tmpfile2"
while(getcommand | getline)... (7 Replies)
Hello
I am trying to do global search on access log files for a date and for either 'Error|error' string
ls -lrt *access* | grep "Sep 23" | awk '{print $9}'|xargs awk '/23\/Sep\/2011/ && /Error/ || /error'
Above matches All lines with 'error' as well unfortunately.
Is there a... (6 Replies)
Hello;
Trying to figure out how to keep just the contents between the two search lines:
awk '/regexp_1/ ,/regexp_2/'
I do not want lines containing regexp_1 and regexp_2 in the output.
Thank you for any ideas
Video tutorial on how to use code tags in The UNIX and Linux Forums. (5 Replies)
Hello;
I need to print two previous lines after searching for a reg exp:
awk '/haywood/'
should produce the following
===================
p9J46THe020804 89922 Tue Oct 18 21:06 MAILER-DAEMON
(host map: lookup (haywood.com): deferred)
... (1 Reply)
Learning, stumbling! My progress in shell scripting is slow. Now I have this doubt:
I have the following file (users.txt):
AU0909,on
AU0309,off
AU0209,on
AU0109,off
And this file (userson.txt)
AU0909
AU0209
AU0109
AU0309
I just want to set those users on userson.txt to "off" in... (14 Replies)