Re: simple awk question

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

 



On Mon, Oct 20, 2003 at 11:17:58AM +0300, urgrue wrote:
> how can i print all BUT the last field. ie something like:
> echo one.two.three.four | awk -F "." '{print <all from $1 to $(NF-1)>}'
> =one.two.three

echo one.two.three.four | awk -F "." \
 '{for (i=1; i<NF-1 ;i++) {printf("%s.",$i)};printf("%s\n",$(NF-1))}'



-chuck
-- 
ACCEL Services, Inc.| Specialists in Gravity, Magnetics |  1(713)993-0671 ph.
 2401 Fountain View |   and Integrated Interpretation   |  1(713)993-0608 fax
     Suite 320      |                                   |
 Houston, TX, 77057 |          Chuck Campbell           | campbell@xxxxxxxxxxxx
                    |  President & Senior Geoscientist  |

     "Integration means more than having all the maps at the same scale!"
-
: send the line "unsubscribe linux-admin" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Newbie]     [Audio]     [Hams]     [Kernel Newbies]     [Util Linux NG]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Device Drivers]     [Samba]     [Video 4 Linux]     [Git]     [Fedora Users]

  Powered by Linux