Hi,
I have over 3 years experience on the Solaris O/S, not a lot I agree, but I wish to try for Certification.
Has anyone any tips on how to best do this;
Should I set up a machine at home and install Solaris 9 on this, as a sandbox, or can the exam be done on a purely theoretical basis?
I...
If I could get something to start with, I'd hope to take it from there.... I'm still learning this stuff & am not to good with loops & stuff yet....
L.
I get you Vlad, so pipe to something & use getline to read them back in again? Or an array - that much I can do - the backreferencing I will have problems with, and tips for starting this?
Thanks CaKiwi,
One more question; If I am not using the getline function and am just using
eg.
if ($0 ~ /error/ )
I believe this sets my next usage of $0 to the line containing error; how do I escape this /avoid this & next time I use $0 use the entire ( original )file...
This question concerns getlinel;
My understanding of getline is that once it is used; the new value of $0 is used in testing against the patterns of any subsequent rules, may this e prevented & if so how?
flogrr,
Thanks for your help, I've figured that much out, but what I'm trying to do is a little different & I should have elaborated.... this is my code
test = $1
print "THIS IS TEST" test
where = match($0, "test")
It's pretty simple, but I'm assigning the variable...
hi,
If I have a command in awk such as;
awk '/error/ { print $7}' errorlog.log
This will give me a list of all the $7 variables in the line containing 'error', now what if I wish to use the $7 variable to test the file again ( errorlog.log ), using this $7 as the input value i.e.
awk '/$7/ {...
Hi,
The log file I'm working with appears as follows;
[07/Oct/2002: 12:01:03] uid : 'kelly'
[07/Oct/2002: 12:01:03] Login from server 'qa1sa'
[07/Oct/2002: 12:01:03] IP > 100 : "101.101.101.101"
[07/Oct/2002: 12:01:04] result : 'kelly' Failed.
This is an excerpt..... Basically...
OK I can see where you're coming from... apoligies, firstly the for was for tesing purposes....
so in reality I am using;
/uid:/ {
split ($0, a, " ")
print a[6]
}
The pattern /uid/ filters out all of the uids in the log.file ( this is a really big file); so I get a list of names...
I'm running it as...
awk -f awkscript log
The input is completely semented... Basically I wish to get one value like i'm doing in the part;
/uid:/ { for (i=1; i < NF; ++i);
split ($0, a, " ")
print a[6]
}
Then I wish to use the value in this array a[6] to cross reference another...
This is what I am testing to do this
/patten1/ { for (i=1; i < NF; ++i);
split ($0, a, " ")
print a[6]
}
The next step here is to do another pattern search to find a new value, but when modify script to be something like
/patten1/ { for (i=1; i < NF; ++i);
split ($0, a, "...
Hi,
I need to use several pattern matches such as
/pattern/
in my script, however it seems that when i do the first one, the write some awk statements, then open the second one, I get an error, how is it possible to use several patterns?
ps. I am able to do;
/pattern1/ { print }
/patern2/...
Hi all,
I wish to write an awk script however for now all I need to do is get the line with the following character - it occurs often... the line is
200 > 120
however awk does not allow me use /200 > 120/ or /200 && 120/ do not work.... anyone have any ideas how to get these lines out?
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.