I have recently just started using awk in shell scripting. I find it is easier to use and faster in both development and performance than running a perl script. I find that awk is very useful. One of the uses I like is parsing a configuration file for a specific line and then parsing the line for a specific entry i.e.
 grep IPADDRESS config.txt | awk -F":" '{print $2}'

if you want all of the columns for that line simply forget the awk, if you want to use awk, use '{print $0}'.

Mbright


From: Tony Vance <[EMAIL PROTECTED]>
Reply-To: BYU Unix Users Group <[email protected]>
To: [email protected]
Subject: [uug] Quick awk question
Date: Thu, 04 Aug 2005 14:01:28 -0400

Hi everyone,

I have a quick awk question. What is the awk command to print out all columns of a file excluding the first column? I needed a quick answer so I already got what I needed by resorting to the cut command. But out of curiosity, is this relatively simple in awk? And for discussions sake, do any of you feel that the merit of learning awk is any less now that we have such powerful and multi-purpose scripting languages as Python and Perl?

Best,

Tony

--------------------
BYU Unix Users Group http://uug.byu.edu/

The opinions expressed in this message are the responsibility of their
author. They are not endorsed by BYU, the BYU CS Department or BYU-UUG. ___________________________________________________________________
List Info: http://uug.byu.edu/cgi-bin/mailman/listinfo/uug-list



--------------------
BYU Unix Users Group http://uug.byu.edu/
The opinions expressed in this message are the responsibility of their
author. They are not endorsed by BYU, the BYU CS Department or BYU-UUG. ___________________________________________________________________
List Info: http://uug.byu.edu/cgi-bin/mailman/listinfo/uug-list

Reply via email to