good awk guide? (or, help me figure out this command)

Status
Not open for further replies.

lopoetve

Extremely [H]
2FA
Joined
Oct 11, 2001
Messages
34,263
I need awk to open a file (hardcoded filename), search for a string (it's stored in an environment variable), take the one line that has that string (guaranteed to ONLY have one) and split it based on :, and then save the 3rd part of the array (created by the split command) to another environment variable.

Anyone have a good guide on how to do something like that (and DONT say the one at http://www.vectorsite.net/tsawk.html , because it sucks balls and the syntax is all wrong in their examples), or know how to whip that up real fast? I'm horribly stuck :(

edit: Yes, this has to be done in a single command line command, so no program file or anything like that. And no, I can't use perl (OH GOD I WISH I COULD). And it's being called by a simple /bin/sh script.
 
closing this, found a way to do it that leads to a totally different question ;)
 
Status
Not open for further replies.
Back
Top