![]() |
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here. |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| awk script to calculate total | appsguy616 | Shell Programming and Scripting | 2 | 11-25-2008 11:21 AM |
| Awk help needed to calculate total | senthilkumar_ak | Shell Programming and Scripting | 7 | 08-22-2008 12:47 AM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
Calculate total sum from a file
The file content is dynamic and using this format:
Code:
name1 number1 name2 number2 name3 number3 name4 number4 .................... |
|
||||
|
Oh thats an easy one. There is also 'bc' but that would be for really hard core math, and then there is "let".. but dont worry with those.. you can just use awk.
Code:
-bash-3.2$ cat test.txt
one 1
two 2
three 3
four 4
five 5
six 6
seven 7
eight 8
nine 9
ten 10
-bash-3.2$ awk '{count += $2;} END { print count; }' test.txt
55
|
|
||||
|
to get the column by comparing a word
Hi all,
I am new to this forums so was not able to find to post new forums hence i posted in the already existing form please help me with the below requirement I have a requirement as below I want to grep xyz and get the result domain name as "unix.com" 3.209.12.09 xyz xyz.unix.com Last edited by rakesh_pagadala; 05-27-2009 at 06:18 PM.. |
|
||||
|
Quote:
There is an another clause over here which i found just now ... xyz.unix.com can come any where in the line it need not be at $3 every time |
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|