The UNIX and Linux Forums  


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




Thread: awk on a string
View Single Post in the UNIX and Linux Forums - Click on the Thread or Permalink to View Entire Thread -->
  #3 (permalink)  
Old 07-24-2008
radoulov's Avatar
radoulov radoulov is offline Forum Staff  
addict
  
 

Join Date: Jan 2007
Location: Варна, България / Milano, Italia
Posts: 2,918
Quote:
Originally Posted by melanie_pfefer
[...]awk however expects a file:
It's the expected behavior. If you really need to do something like this with AWK, you should write something like this:

Code:
awk 'BEGIN { 
  split(ARGV[1], t, ":")
  print t[3]
  }' a:b:c