Sponsored Content
Top Forums Shell Programming and Scripting how do you to add numbers incrementally? Post 57554 by kiem on Monday 1st of November 2004 07:14:09 PM
Old 11-01-2004
how do you to add numbers incrementally?

I've refined the filesystem size using awk and directed to a file name.

eg, here's the content in a file called "numbers"

$cat numbers
345
543
23423456
44435
546
.
.

how do you write a script to all these numbers to get the total?

thanks a lot.
 

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Add some numbers!

im using this command to return the number of links in my directory, grep -c -i -h "href" *html */*html *htm *shtml is there a way of adding these to get the total? Cheers (3 Replies)
Discussion started by: TalkShowHost
3 Replies

2. Shell Programming and Scripting

How to add numbers?

:confused: I have plain text file "tmp" which include a range of numbers(bytes), say like: 123 234 567 2434 2323 213123 How can I add them and display out. should I use AWK, then how? I am a newer in Bourne shell, please give me a hand, thanks a lot (7 Replies)
Discussion started by: pnxi
7 Replies

3. Shell Programming and Scripting

How to add numbers

Hello. I new to Shell Scripting. I have a file and here is the output of the file. 1.1M 1.1M 3.3M 149K 61K 75K 144K 135K 82K 170K 327K 2.0M 219K 165K (8 Replies)
Discussion started by: email-lalit
8 Replies

4. UNIX for Dummies Questions & Answers

how can i add two numbers

hi, i am having one file which looks like the one below: ABC1 *** 1 4 ABC2 *** 7 12 ABC3 *** 0 34 ... (4 Replies)
Discussion started by: kripssmart
4 Replies

5. Shell Programming and Scripting

Using Awk to Add Numbers

echo "0.1 2.0 0.4 2.0 4.3 1.0 6.0 9.0" | awk 'BEGIN {total=0} {total += $1} END {print total}' I want to add the above output from the echo command, but i can't figure this out. The output above always spits out inaccurate numbers. can someone please provide me with a one liner similar to... (4 Replies)
Discussion started by: SkySmart
4 Replies

6. Shell Programming and Scripting

Increase two numeric variables incrementally together

Hi, I was wondering if someone could help with what is probably a fairly easy problem. I have two variables, i is between 1-5, j is between 11-15 I'd like to produce this: 1_11 2_12 3_13 4_14 5_15 Each number goes up incrementally with the other. But my shoddy code is not... (5 Replies)
Discussion started by: hubleo
5 Replies

7. Shell Programming and Scripting

Linux command rsync sending files incrementally

Please, i have a question about rsync command: Here is the command that i have used in my script: rsync -ratlz --rsh="/usr/bin/sshpass ssh -o StrictHostKeyChecking=no" -aAXHltzh --progress --numeric-ids --devices --rsync-path="rsync" $1 $hostname:$1 using this command, i can... (0 Replies)
Discussion started by: chercheur111
0 Replies

8. Shell Programming and Scripting

Splitting a file incrementally

Dear all, I would like to split a file incrementally. My file looks like: $path { $name "path_sparc_ifu_dec_1" ; $transition { "dtu_inst_d" v ; // (in) "U622/Y" ^ ; // (INVX16_LVT) "U870/Y" ^ ; // (AND2X1_LVT) "U873/Y" v ; // (INVX1_LVT) "U872/Y" ^ ; // (NAND3X0_LVT)... (3 Replies)
Discussion started by: jypark22
3 Replies

9. Shell Programming and Scripting

Read files incrementally and search for particular string.

Example I have following requirements where i need to search for particular string from the log files.Files will be archived with number attached end to it and creates a new log file. First Day i will ran at 8:00 AM Filename:a.log1 Wed Aug 24 04:46:34... (1 Reply)
Discussion started by: nareshnani211
1 Replies
MOUNT_CD9660(8) 					    BSD System Manager's Manual 					   MOUNT_CD9660(8)

NAME
mount_cd9660 -- mount an ISO-9660 filesystem SYNOPSIS
mount_cd9660 [-egjr] [-o options] [-s startsector] special | node DESCRIPTION
The mount_cd9660 command attaches the ISO-9660 filesystem residing on the device special to the global filesystem namespace at the location indicated by node. This command is normally executed by mount(8) at boot time. The options are as follows: -e Enable the use of extended attributes. -g Do not strip version numbers on files. (By default, if there are files with different version numbers on the disk, only the last one will be listed.) In either case, files may be opened without explicitly stating a version number. -j Do not use any Joliet extensions included in the filesystem. -o Options are specified with a -o flag followed by a comma separated string of options. See the mount(8) man page for possible options and their meanings. -r Do not use any Rockridge extensions included in the filesystem. -s startsector Start the filesystem at startsector. Normally, if the underlying device is a CD-ROM drive, mount_cd9660 will try to figure out the last track from the CD-ROM containing data, and start the filesystem there. If the device is not a CD-ROM, or the table of contents cannot be examined, the filesystem will be started at sector 0. This option can be used to override the behaviour. Note that startsector is measured in CD-ROM blocks, with 2048 bytes each. SEE ALSO
mount(2), unmount(2), fstab(5), mount(8) BUGS
POSIX device node mapping is currently not supported. Version numbers are not stripped if Rockridge extensions are in use. In this case, accessing files that don't have Rockridge names without version numbers gets the one with the lowest version number and not the one with the highest. There is no ECMA support. HISTORY
The mount_cd9660 utility first appeared 4.4BSD. 4th Berkeley Distribution March 27, 1994 4th Berkeley Distribution
All times are GMT -4. The time now is 10:09 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy