Sponsored Content
Full Discussion: adding hundreds of numbers
Top Forums UNIX for Dummies Questions & Answers adding hundreds of numbers Post 302355908 by chakrapani on Thursday 24th of September 2009 04:45:57 AM
Old 09-24-2009
with awk

Code:
awk '{ tot = $1 + tot } END { print tot }' file.txt

 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Adding 2 numbers

I would like to write a script with BASH to add two numbers (integer) and write the result to the standard output. Please help! (7 Replies)
Discussion started by: Viper01
7 Replies

2. Shell Programming and Scripting

adding float numbers

how to add 2 float values to each other? i tried this and it doesnt work: #!bin/bash numone=1.234 numtwo=0.124 total=`expr $numone + $numtwo` echo $total thanks (5 Replies)
Discussion started by: strike
5 Replies

3. UNIX for Advanced & Expert Users

Adding a column of numbers

Hello, I have a file, and one column has both positive and negative numbers. Does anyone know how I can calculate the total of all the values (i.e, +ve and -ve). eg: col1 col2 col3 data 23 data data 76 data data -30 data Thanks Khoom (1 Reply)
Discussion started by: Khoomfire
1 Replies

4. Shell Programming and Scripting

adding a list of numbers 3 by 3

i have a list of numbers like this; 124 235 764 782 765 451 983 909 ... and i want to make a sum with the first 3 of them then the next 3 and so on. 124+235+764=1123 782+765+451=1998 ... some ideas? (4 Replies)
Discussion started by: Tártaro
4 Replies

5. UNIX for Dummies Questions & Answers

Adding numbers in unix

Hi this is quite a simple question... I am new to LINUX/UNIX and so I am just trying to create a very basic program. The idea is that when the user runs the program (from the shell) they enter 3 values and the program will add them up: "./sum 23 5 1 29" my code for this program is as follows: ... (4 Replies)
Discussion started by: csuieb
4 Replies

6. Shell Programming and Scripting

Adding numbers

Hi I figured how to add my list of numbers. However how do I count so that after a certain number it lists the line. Example: 12 test1 46 test2 195 test3 174 test4 634 test5 185 test6 94 test7 So basically add the numbers and when the addition reaches 300 or less print the... (8 Replies)
Discussion started by: bombcan
8 Replies

7. Shell Programming and Scripting

Adding row of numbers

is there another way of doing the below: echo "7 3 8 2 2 1 3 83.4 8.2 4 8 73 90.5" | bc shell is bash. os is linux and sunos. bc seems to have an issue with long range of numbers (12 Replies)
Discussion started by: SkySmart
12 Replies

8. Shell Programming and Scripting

help with adding up numbers

I have a file which has following contents which I want to add up. 28170.24 28170.24 28170.24 28170.24 28170.24 28170.24 28170.24 28170.24 28170.24 28170.24 28170.24 28170.24 28170.24 28170.24 139038.72 139038.72 139038.72 139038.72 (5 Replies)
Discussion started by: aksijain
5 Replies

9. UNIX for Dummies Questions & Answers

Adding Column Of Numbers

Hello. Trying to add a column of numbers and combine the 1st and 2nd fields as uniq with the new total. This works to add the numbers but can't figure an easy was to combine the 1st and 2nd column as the list is very long. awk '{s+=$3} END {print s}' bird dog 300 bird dog 100 cat clown 200... (1 Reply)
Discussion started by: jimmyf
1 Replies

10. Shell Programming and Scripting

Adding (as in arithmetic) to numbers in columns in file, and writing new file with new numbers

Hi again. Sorry for all the questions — I've tried to do all this myself but I'm just not good enough yet, and the help I've received so far from bartus11 has been absolutely invaluable. Hopefully this will be the last bit of file manipulation I need to do. I have a file which is formatted as... (4 Replies)
Discussion started by: crunchgargoyle
4 Replies
CNEE(1) 						      General Commands Manual							   CNEE(1)

NAME
cnee - record, replays or distributes X11 data SYNOPSIS
cnee [options] DESCRIPTION
The program cnee can record and replay an X session. cnee also has the ability to distribute events to multiple displays. cnee gets copies of X protocol data from the X server. These are either printed to file ( record mode) or replayed and synchronised ( replay mode). During record and replay cnee can distribute the record/replayed events to multiple displays. GENERAL OPTIONS
--err-file, -e <file> Redirect all Xnee verbose output file_name(default is stderr) --out-file, -o <file> Redirect all Xnee data to file_name(default is stdout) --display, -d <displayname> X server to contact (default is localhost) --all-clients, -ac Record all client's data (default) --data-to-record, -dtr <n> Intercept n numbers of data ( n<0 means forever) --time, -t <secs> Delay start of application for <secs> seconds. Can be used to prevent recording of KeyRelease when starting Xnee from terminal --record, -rec Set recording mode --replay, -rep Set replaying mode --distribute, -di <LIST> Distribute recorded or replayed events to LIST where LIST is comma separated list of displays --future-clients, -fc Record future client's data (default) --plugin, -p <name Use the plugin name --verbose, -v Enable verbose printout --feedback-xosd, -fx Use xosd to feedback --feedback-stderr, -fs Use stderr to feedback --feedback-none, -fn Dont' use feedback --device-event-range, -devera <X_LIST> Set device event range to X_LIST --keep-autorepeat, -ka Keep autorepeat during record/replay --no-reparent-recording, -nrr Prevent explicit recording of ReparentNotify event RECORD OPTIONS
--first-last Print only first and last of multiple successive MotionEvent --all-events Intercept all events --events-to-record, -etr <n> Intercept n numbers of events ( n<0 means forever) --seconds-to-record, -str <n> Intercept for n seconds ( n<0 means forever) --recorded-resolution <res> Resolution to use when recording is set to res --human-printout, -hp Prints human readable --store-mouse-position, -smp Store the initial position of the mouse --request-range, -reqra <X_LIST> Set request range to X_LIST --reply-range, -repra <X_LIST> Set reply range to X_LIST --delivered-event-range, -devra <X_LIST> Set delivered event range to X_LIST --error-range, -erra <X_LIST> Set error range to X_LIST --extension-request-major-range, -erqmar <X_LIST> Set extension request major range to X_LIST --extension-request-minor-range, -erqmir <X_LIST> Set extension request minor range to X_LIST --extension-reply-major-range, -erpmar <X_LIST> Set extension reply major range to X_LIST --extension-reply-minor-range, -erpmir <X_LIST> Set extension reply minor range to X_LIST REPLAY OPTIONS
--speed-percent, -sp <speed> Set replaying speed percentage is set to speed --replay-resolution <res> Resolution to use when replaying is set to res --resolution-adjustment Use resolution adjustment --synchronised-replay Synchronise during replay --no-synchronise, -ns Don't use synchornisation during replay --recall-window-position, -rwp Recall the recorded window position to be used during replay --force-replay, -fp Keep replaying even if we are out of sync .... dangerous --buffer-verbose, -bv Enable verbose printout of replay buffer --max-threshold, -mat <nr> Set the maximum threshold for sync to nr --min-threshold, -mit <nr> Set the minimum threshold for sync to tnr --tot-threshold, -tot <nr> Set the total threshold for sync to nr --replay-offset, -ro <x,y> Set the replay offset to (x,y) CNEE OPTIONS
--file, -f <file_name> Read data from file file_name (default is stdin) --help, -h Print this message --flags Prints all flags/options xnee accepts --project, -pr <file_name> Use project file file_name --version, -V Print product information --retype-file <file> Types (faking user) the contents of the specified file --write-settings <file> Writes settings to a resource file --print-settings, -ps Prints Xnee settings and waits (for <ENTER>) --print-event-names, -pens Prints X11 event number and name --print-event-name, -pen <ev> Prints X11 event number or name coresponding to ev --print-error-names, -perns Prints X11 error number and name --print-error-name, -pern <er> Prints X11 error number or name coresponding to er --print-reply-names, -pren Prints X11 reply number and name --print-request-names, -prns Prints X11 request number and name --print-request-name, -prn <req> Prints X11 request number or name coresponding to req --keyboard Record the keyboard --mouse Record mouse events --print-data-names, -pdn Prints X11 data number and name --manpage Prints Xnee help text in format as used when generating man page --texipage Prints Xnee help text in format as used when generating info page --type-help Type this help message using faked keys (used to test xnee itself) --demonstration, -demo Let Xnee take you on a demonstration ride --check-syntax, -cs Check syntax of the command line and/or project file (no exec) --get-xinput-event-base, -gxeb Get the event base for Xinput Extension --disable-xinput-events, -dxe Disable recording of XInput events --replay-backend, -rb <backend> --force-core-replay, -fcr Discard record X Input device data, use recorded core device data --record-replay, -rr Record and replay a session (press q to stop recording) COMMENTS
file_name Name of a file (e.g /tmp/my_file.xns) display_name Name of a display (e.g 192.168.1.12:0 secs Seconds (e.g 10) n Integer number (e.g 100) LIST Comma separated list of display (e.g 192.168.1.12:0,129.12.23.0:0) X_LIST Comma separated list of integers (e.g 12-23,35,45-56) EXAMPLES
cnee --record --events-to-record 1000 --mouse --keyboard -o /tmp/xnee.xns -e /tmp/xnee.log -v Records 1000 events (keyboard and mouse) to file /tmp/xnee.xns and dumps the verbose printout to /tmp/xnee.log cnee --replay -f /tmp/xnee.xns -v -e /tmp/xnee.log -ns Read data from /tmp/xnee.xns, replay it and verbose print to file /tmp/xnee.log For more examples, read the Xnee manual AUTHOR
Henrik Sandklef. REPORTING BUGS
Report bugs in the program to bug-xnee@gnu.org. COPYRIGHT
Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007 Henrik Sandklef. This is free software; see the source for copying conditions. There is NO warranty;not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. SEE ALSO
cnee(info),xnee(info),xev(1) VERSION
xnee man page, version 3.13 NOTES
This page describes cnee. Mail corrections and additions to bug-xnee@gnu.org xnee 2007 CNEE(1)
All times are GMT -4. The time now is 01:31 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy