Re: script help - '3rd last field'

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]



> I am pretty sure there is a way in awk to figure out how many fields
> you have, then take the total # of fields -3 each time to get the
> third last one.  Just heading out the door and off hand can't remember
> how it would be done.
>
>   

i can do it in cheetah templating with

set myloc = $getVar("hostname","")split('.')[-3]

the -3 says the last 3rd field in the string - i need the same so maybe 
awk can do this
_______________________________________________
CentOS mailing list
CentOS@xxxxxxxxxx
http://lists.centos.org/mailman/listinfo/centos

[Index of Archives]     [CentOS]     [CentOS Announce]     [CentOS Development]     [CentOS ARM Devel]     [CentOS Docs]     [CentOS Virtualization]     [Carrier Grade Linux]     [Linux Media]     [Asterisk]     [DCCP]     [Netdev]     [Xorg]     [Linux USB]
  Powered by Linux