Hello, I need some help to correct my algorithm steps to sum a number. I am confused... please input some steps
Example:
Let's say a number 5.
Now we can get a list of numbers: 1, 2, 3, 4 (less than 5 in sorted order).
so the sum could be: 1+4; 2+3 ( 1+1+1+1+1 or 1+2+2 is not a solution).
Hello everybody, I have been using my social security number for my taxation purposes. But, I have been recently intimidated by my lawyer that since the crime of identity theft has been on the high I should be careful in using it. I am really concerned about this and need to know whether there are... (1 Reply)
Hi All,
I have the following input which i want to process using AWK.
Rows,NC,amount
1,1202,0.192387
2,1201,0.111111
3,1201,0.123456
i want the following output
count of rows = 3 ,sum of amount = 0.426954
Many thanks (2 Replies)
Hi
i data looks like this:
student 1
Subject1 45 55
Subject2 44 55
Subject3 33 44
//
student 2
Subject1 45 55
Subject2 44 55
Subject3 33 44
i would like to sum $2, $3 (marks) and divide each entry in $2 and $3 with their respective sums and print for each student as $4 and... (2 Replies)
I am trying to figure out the OS version of my Linux box. I got three commands:
# uname -a
Linux test01 2.6.18-238.el5 #1 SMP Thu Jan 13 15:51:15 EST 2011 x86_64 x86_64 x86_64
# cat /proc/version
Linux version 2.6.18-238.el5 (mockbuild@builder10.centos.org) (gcc version 4.1.2 20080704... (4 Replies)
I have a simple text file having payment amount value on each line. At the end of day 'n' number of payments created difference in amount that I need to match from this file.
I have information about how many payments created difference and difference amount. Please help me to build shell... (3 Replies)
I have a file that looks like this:
HP ColorPlotter Z-6100
ACMARTIN IP 192.168.x.x
"VIRTUAL HP ( C9468A ) PART 1 of 2 (REAL CARTRIDGE 1)"
"VIRTUAL HP ( C9468A ) PART 2 of 2 (REAL CARTRIDGE 1)"
181
181
"VIRTUAL HP ( C9471A ) PART 1 of 2 (REAL CARTRIDGE 2)"
"VIRTUAL HP ( C9471A ) PART 2... (4 Replies)
Discussion started by: SysAdminRialto
4 Replies
LEARN ABOUT OSF1
sum
sum(1) General Commands Manual sum(1)NAME
sum - Displays the checksum and byte count in block-size (1024) units of a file
SYNOPSIS
sum [-o | -r] [file...]
The sum command reads file and calculates a 16-bit checksum and the byte count in block-size (1024) units in the file. If the file argu-
ment is omitted, sum reads standard input.
STANDARDS
Interfaces documented on this reference page conform to industry standards as follows:
sum: XCU5.0
Refer to the standards(5) reference page for more information about industry standards and associated tags.
OPTIONS
[Tru64 UNIX] Uses an algorithm to compute the checksum using word-by-word computation. Uses an alternate algorithm to compute the check-
sum (rigorous byte-by-byte computation rather than the word-by-word computation).
[Tru64 UNIX] This is the default.
OPERANDS
The file for which a checksum is to be computed. If this operand is omitted, standard input is used.
DESCRIPTION
The checksum and number of blocks are written to standard output. The sum command is generally used to determine if a file that was copied
or communicated over transmission lines is an exact copy of the original. The sum command writes the space used in 1024-byte units.
[Tru64 UNIX] The checksum is calculated using a rigorous byte-byte computation by default.
System V Compatibility
[Tru64 UNIX] The checksum algorithms for the default sum command and the SVID 2 compliant sum command are reversed. The SVID 2 compliant
sum command uses the word-by-word algorithm by default and uses the byte-by-byte algorithm if you specify the -r option on the command
line.
NOTES
The sum utility is marked LEGACY in XCU Issue 5. [Tru64 UNIX] The default algorithm is no longer the word-by-word computation algorithm.
It was changed to the 4.3BSD default algorithm. The algorithms used may not be portable, that is, the same checksum may not be produced
for the same input on different systems. Portable applications should use cksum.
EXIT STATUS
The following exit values are returned: Successful completion. An error occurred.
EXAMPLES
To display the checksum of datafile and the number of blocks in this file, enter: sum datafile
If the checksum of datafile is 1605 and if the file contains 3 blocks, sum displays: 1605 3 datafile
ENVIRONMENT VARIABLES
The following environment variables affect the execution of sum: Provides a default value for the internationalization variables that are
unset or null. If LANG is unset or null, the corresponding value from the default locale is used. If any of the internationalization vari-
ables contain an invalid setting, the utility behaves as if none of the variables had been defined. If set to a non-empty string value,
overrides the values of all the other internationalization variables. Determines the locale for the interpretation of sequences of bytes
of text data as characters (for example, single-byte as opposed to multibyte characters in arguments). Determines the locale for the for-
mat and contents of diagnostic messages written to standard error. Determines the location of message catalogues for the processing of
LC_MESSAGES.
SEE ALSO
Commands: cksum(1), wc(1)
Standards: standards(5)sum(1)