• FEATURED
• FEATURED
• FEATURED
• FEATURED
• FEATURED

View more

View more

• ##### Unreal Awards $275k in Latest Round of Unreal Dev Grants • ##### Unreal 4.16 Released • ##### Microsoft's Slim AR Form Factor • ##### YoYo Games Releases GameMaker 2 Education edition View more ### Image of the Day Submit IOTD | Top Screenshots ### The latest, straight to your Inbox. Subscribe to GameDev.net Direct to receive the latest updates and exclusive content. Sign up now # awk in perl Old topic! Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic. 1 reply to this topic ### #1Jarwulf Members Posted 04 April 2013 - 05:15 PM Hi, I ran across this line in a perl file system ("awk \'\$1 == \"$label\" && \$3 <= $apex && \$4 >= $apex\{print\}\'$reference >temp_marker_$name") ==0 or die "$0 failed to awk";

Does anyone have an idea of what its doing? It seems to be printing out if some comparisons are met is as far as I figure.

Also what is with a variable name like temp_marker_$name? Aren't scalar variables supposed to start with$ and not have them in the middle? What is the purpose of the slashes in the awk command?

### #2Ectara  Members

Posted 04 April 2013 - 05:19 PM

The way it looks is that the backslashes are escaping characters that would be recognized as syntactically significant in perl, so that those characters are passed as-is to awk. As far as temp_marker_$name, it seems to be expanding the value of$name in-place where it is referred to in the string, sort of like Bash scripting. This would result in a name like temp_marker_foo, if \$name is holding the value of "foo".

As far as the actual purpose of the awk command's arguments, someone else will have to answer.

Old topic!

Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.