Re: don't print last field

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

 



On Tue, Nov 11, 2008 at 04:44:16AM +0800, adrian kok wrote:
> Hi 
> 
> how can I only get the previous field but not last
> field from awk?
> 
> but I can't use print $1....$2
> 
> as there are different fields in different line
> 
> thank you
> 

Does knowing the number if fields in a line help?

  "`NF' is a built-in variable whose value is the number of fields in the
  current record.  `awk' automatically updates the value of `NF' each
  time it reads a record. ..."

-- 
	T o m  M i t c h e l l 
	Found me a new hat, now what?

-- 
fedora-list mailing list
fedora-list@xxxxxxxxxx
To unsubscribe: https://www.redhat.com/mailman/listinfo/fedora-list
Guidelines: http://fedoraproject.org/wiki/Communicate/MailingListGuidelines

[Index of Archives]     [Current Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]     [Fedora Docs]

  Powered by Linux