Hi,
i want to sum all nubers in one column. Example:
12.23
11
23.01
3544.01
I'm trying to do this in awk, but it doesn't work properly.
Seems like awk is summing only integers, for example:
12
11
23
3544
It cuts off numbers after dot.
I used this command:
akw /text/ file.txt |nawk... (1 Reply)
hello im looking for short way to sum numbers from stdout the way i found to do it is to long for me i wander if there is shorter way to do it
ok it 2 stage action
this will make the list of number in to file sum.txt
grep -c include *.c | awk '{l=split($0,a,":");print a;}' > sum.txt
this... (1 Reply)
Use and complete the template provided. The entire template must be completed. If you don't, your post may be deleted!
1. The problem statement, all variables and given/known data:
Shell script to find sum of first n numbers of Fibonacci series
2. Relevant commands, code, scripts,... (0 Replies)
cat *.out |grep "<some text>" | awk '{print $6}'
For ex,This will reutrn me
11111
22222
is it possible to add these two numbers in the above given command itself?I can write this to a file and find the sum.
But I prefer to this calculation in the above given line itself.
Any... (3 Replies)
I basically have a file where I had to do a bunch of greps to get a list of numbers
example: a file called numbers.txt
10000
10000
superman
10000
batman
10000
10000
grep '100' * |
10000
10000
10000
10000
10000 (2 Replies)
Hi all;
Here is my file:
V1.3=4
V1.4=5
V1.1=3
V1.2=6
V1.3=6
Please, can you help me to write a script shell that counts the sum of values in my file (4+5+3+6+6) ?
Thank you so much for help.
Kind regards. (3 Replies)
I want to count the number of lines, I need this result be a number, and sum the last numeric column, I had done to make this one at time, but I need to make this for a crontab, so, it has to be an script, here is my lines:
It counts the number of lines:
egrep -i String file_name_201611* |... (5 Replies)
I need help with this assignment. I'm very new to using UNIX/LINUX, and my only previous experience with programing anything is using python.
We are writing scripts using vim, and this one I'm stumped on.
"Write a shell script that finds and display the sum of even positive integers from 0 to... (5 Replies)
Discussion started by: Nastybutler
5 Replies
LEARN ABOUT X11R4
cpan
CPAN(1) Perl Programmers Reference Guide CPAN(1)NAME
cpan - easily interact with CPAN from the command line
SYNOPSIS
# with arguments and no switches, installs specified modules
cpan module_name [ module_name ... ]
# with switches, installs modules with extra behavior
cpan [-cfimt] module_name [ module_name ... ]
# without arguments, starts CPAN.pm shell
cpan
# without arguments, but some switches
cpan [-ahrvACDLO]
DESCRIPTION
This script provides a command interface (not a shell) to CPAN. At the moment it uses CPAN.pm to do the work, but it is not a one-shot com-
mand runner for CPAN.pm.
Meta Options
These options are mutually exclusive, and the script processes them in this order: [hvCAar]. Once the script finds one, it ignores the
others, and then exits after it finishes the task. The script ignores any other command line options.
-a Creates the CPAN.pm autobundle with CPAN::Shell->autobundle.
-A module [ module ... ]
Shows the primary maintainers for the specified modules
-C module [ module ... ]
Show the "Changes" files for the specified modules
-D module [ module ... ]
Show the module details. This prints one line for each out-of-date module (meaning, modules locally installed but have newer versions
on CPAN). Each line has three columns: module name, local version, and CPAN version.
-L author [ author ... ]
List the modules by the specified authors.
-h Prints a help message.
-O Show the out-of-date modules.
-r Recompiles dynamically loaded modules with CPAN::Shell->recompile.
-v Print the script version and CPAN.pm version.
Module options
These options are mutually exclusive, and the script processes them in alphabetical order. It only processes the first one it finds.
c Runs a `make clean` in the specified module's directories.
f Forces the specified action, when it normally would have failed.
i Installed the specified modules.
m Makes the specified modules.
t Runs a `make test` on the specified modules.
Examples
# print a help message
cpan -h
# print the version numbers
cpan -v
# create an autobundle
cpan -a
# recompile modules
cpan -r
# install modules ( sole -i is optional )
cpan -i Netscape::Booksmarks Business::ISBN
# force install modules ( must use -i )
cpan -fi CGI::Minimal URI
TO DO BUGS
* none noted
SEE ALSO
Most behaviour, including environment variables and configuration, comes directly from CPAN.pm.
SOURCE AVAILABILITY
This source is part of a SourceForge project which always has the latest sources in CVS, as well as all of the previous releases.
http://sourceforge.net/projects/brian-d-foy/
If, for some reason, I disappear from the world, one of the other members of the project can shepherd this module appropriately.
CREDITS
Japheth Cleaver added the bits to allow a forced install (-f).
Jim Brandt suggest and provided the initial implementation for the up-to-date and Changes features.
Adam Kennedy pointed out that exit() causes problems on Windows where this script ends up with a .bat extension
AUTHOR
brian d foy, "<bdfoy@cpan.org>"
COPYRIGHT
Copyright (c) 2001-2006, brian d foy, All Rights Reserved.
You may redistribute this under the same terms as Perl itself.
perl v5.8.9 2009-04-13 CPAN(1)