[CentOS] script help - '3rd last field'
Tom Brown
tom at ng23.netMon Jun 8 09:51:00 UTC 2009
- Previous message: [CentOS] script help - '3rd last field'
- Next message: [CentOS] script help - '3rd last field'
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
> 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
- Previous message: [CentOS] script help - '3rd last field'
- Next message: [CentOS] script help - '3rd last field'
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
More information about the CentOS mailing list