Search Results

Search: Posts Made By: rrk001
4,920
Posted By rrk001
sorry. too late with the reply ;)
sorry. too late with the reply ;)
4,920
Posted By rrk001
you can use the -v argument nawk -v str="01"...
you can use the -v argument

nawk -v str="01" '{total[$10] += 1} END{for (i in total) print str " HTTP/1.1 "i, total[i]}'
9,202
Posted By rrk001
Assuming that the output of mysql command would...
Assuming that the output of mysql command would be :

id name
3 John Smith
18 Alan Parker
41 Bob Johnson


you can try this.

result=$(mysql -e 'SELECT id, name FROM terminal' | awk...
10,677
Posted By rrk001
Hammadi was right about the quotes. They are...
Hammadi was right about the quotes. They are supposed to be backticks.
And if [$bs -lt 1500] should be if [ $bs -lt 1500 ]. Note the difference in whitespaces.
You can also use "test" like if test...
2,520
Posted By rrk001
assuming the text to be replaced would be...
assuming the text to be replaced would be [alphanumeric].[alphanumeric]
2,520
Posted By rrk001
$ cat VRF ...
$ cat VRF
VRF-TM_DummyLab/mse02.lab,mse02.lab,ge-2/0/7.222
VRF-EMS_HUAWEI_MSAN_208/mse01.lab,mse01.lab,xe-1/0/0.208

$ sed 's/\/.[a-zA-Z0-9]*\.[a-zA-Z0-9]*,/\//' VRF...
5,506
Posted By rrk001
yes. it really does. compact piece of code there....
yes. it really does. compact piece of code there. but, if you still want to use shell scripts ;) here you go.
#! /bin/bash
gawk 'BEGIN{
while (getline < "file") {
twothree[$2$3]=$2;
}
for (i...
5,506
Posted By rrk001
if you dont want to call nawk for each record...
if you dont want to call nawk for each record that meets the criteria you can print the required "$2"s to a file and fetch them into an array using getline and split.
5,506
Posted By rrk001
not a very decent solution this. but give it a...
not a very decent solution this. but give it a try.
$ cat file
x a 10
y a 10
z a 11
x b 10
y b 12
z b 10
x c 0
y c 0
x d 1
y d 1
z d 1
w d 2
x e 1
y e 1
z e 1

a,b and d are the...
Showing results 1 to 9 of 9

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