The UNIX and Linux Forums  


Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com



Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Please can any one explain this ${0##/} gadege Shell Programming and Scripting 2 04-01-2008 04:26 PM
Explain the line "mn_code=`env|grep "..mn"|awk -F"=" '{print $2}'`" Lokesha UNIX for Dummies Questions & Answers 4 12-20-2007 01:52 AM
please explain this dummy_needhelp Shell Programming and Scripting 2 10-15-2007 02:17 AM
Print Problem in UNIX. Need to know the option to specify the print paper size ukarthik HP-UX 1 06-07-2007 10:35 AM
if [ $? -eq 0 ] .. can someone explain this? ranjita.c Shell Programming and Scripting 5 10-03-2006 08:50 PM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 04-04-2008
mail2sant mail2sant is offline
Registered User
  
 

Join Date: Apr 2008
Location: bangalore
Posts: 69
plese explain awk '{print \$NF}'

please explain this awk '{print \$NF}'

i have a command

grep -i adding /logs/eap | grep -iv equation | awk '{print \$NF}' | sort -u | sed 's/\.\$//' >> /temp/t


please explain the above awk and sed
as well how it works

and also what is \$NF
  #2 (permalink)  
Old 04-04-2008
djsal djsal is offline
Registered User
  
 

Join Date: Apr 2004
Location: Long Island Ny
Posts: 23
Quote:
Originally Posted by mail2sant View Post
please explain this awk '{print \$NF}'

i have a command

grep -i adding /logs/eap | grep -iv equation | awk '{print \$NF}' | sort -u | sed 's/\.\$//' >> /temp/t


please explain the above awk and sed
as well how it works

and also what is \$NF
The \ is irrelevant! It may be there to indicate that it is part of the same statement (if on two lines).

- The awk '{print $NF}' means print the last field in a space delemmited file.

- Sort -u sort the file, print one recird of each occurence (unique)

- The sed looks likes its trying to replace "." and "$" with nothing.
Closed Thread

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

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 On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 06:30 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0