LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 11-24-2014, 11:01 AM   #1
nadine01
Member
 
Registered: Oct 2014
Posts: 62

Rep: Reputation: Disabled
AWK questions


Hi all,

what means by this in AWK

$0 ~/^s.* AGT/
???
 
Old 11-24-2014, 11:05 AM   #2
nadine01
Member
 
Registered: Oct 2014
Posts: 62

Original Poster
Rep: Reputation: Disabled
thank's i find it
 
Old 11-24-2014, 11:08 AM   #3
jlinkels
LQ Guru
 
Registered: Oct 2003
Location: Bonaire, Leeuwarden
Distribution: Debian /Jessie/Stretch/Sid, Linux Mint DE
Posts: 5,195

Rep: Reputation: 1043Reputation: 1043Reputation: 1043Reputation: 1043Reputation: 1043Reputation: 1043Reputation: 1043Reputation: 1043
LQ etiquette prefers that you post the solution, not just "I found it". As much as you needed help, other might need that as well and might not able to find it.

So thank you for editing your post and briefly indicating what you found.

jlinkels
 
2 members found this post helpful.
Old 11-24-2014, 11:09 AM   #4
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen DK
Distribution: PCLinuxOS2023 Fedora38 + 50+ other Linux OS, for test only.
Posts: 17,511

Rep: Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641
Quote:
thank's i find it
.. Then please mark the thread as SOLVED.

"Thread Tools" >>> 'Mark this thread as solved'.
 
Old 11-24-2014, 11:13 AM   #5
nadine01
Member
 
Registered: Oct 2014
Posts: 62

Original Poster
Rep: Reputation: Disabled
event = $1
level = $4

if (level == "AGT" && event == "s" )

this is in trace file of ns2
 
1 members found this post helpful.
Old 11-24-2014, 07:34 PM   #6
grail
LQ Guru
 
Registered: Sep 2009
Location: Perth
Distribution: Manjaro
Posts: 10,007

Rep: Reputation: 3191Reputation: 3191Reputation: 3191Reputation: 3191Reputation: 3191Reputation: 3191Reputation: 3191Reputation: 3191Reputation: 3191Reputation: 3191Reputation: 3191
Personally I would have to say I do not see how the final solution is related to the original question??

There is no mention of variables in original nor any if context.

In future it may help if you provide a full question, ie. what is required, what data is being worked on, what is the desired output, perhaps some references to where you retrieved the unknown code.
And finally, when you have a solution, relate it to the original question so others may learn from it as well.
 
Old 12-04-2014, 01:08 PM   #7
PTrenholme
Senior Member
 
Registered: Dec 2004
Location: Olympia, WA, USA
Distribution: Fedora, (K)Ubuntu
Posts: 4,187

Rep: Reputation: 354Reputation: 354Reputation: 354Reputation: 354
And, for anyone who finds this looking for an answer to the first question:
$0 ~/^s.* AGT/ is a regular expression test statement, comparing the input line ($0) with the expression "^s.* AGT", which means "A string starting with a lower-case "s", followed by zero or more characters followed by a blank and the upper-case string "AGT"
 
2 members found this post helpful.
  


Reply

Tags
awk-ns2



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] awk and sed questions rock1961 Programming 7 08-03-2011 09:06 AM
[SOLVED] call awk from bash script behaves differently to awk from CLI = missing newlines titanium_geek Programming 4 05-26-2011 09:06 PM
awk or sed to for this questions solution ? cs24 Programming 7 03-20-2010 05:23 AM
awk questions will.flanagan Linux - Newbie 4 04-17-2009 10:59 AM
awk questions? alaios Linux - General 4 05-13-2003 06:50 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 02:01 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration