Sponsored Content
Full Discussion: helo need for data
Top Forums Shell Programming and Scripting helo need for data Post 96723 by mona on Monday 23rd of January 2006 06:44:47 AM
Old 01-23-2006
Try this

Code:
#!/bin/ksh
num=`sed -n -e 's/^!.*$/&/p' xyz | sed 's/.*: \([0-9]*\) fail(s)./\1/'`
TOTAL=0
for i in $num
do
(( TOTAL = TOTAL + i )) 
done
print "Total number of failures is $TOTAL"

Code:
/export/home/test/mons>xyz.sh
Total number of failures is 8

 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

helo,every!

Hello,every one!I'm a new comer,and I'm form China.I have learnd UNIX only one year,so don't hesitate to point my error.Thank you…….! :p :p :p (4 Replies)
Discussion started by: main1984
4 Replies

2. UNIX for Dummies Questions & Answers

Howto capture data from rs232port andpull data into oracle database-9i automatically

Hi, i willbe very much grateful to u if u help me out.. if i simply connect pbx machine to printer by serial port RS232 then we find this view: But i want to capture this data into database automatically when the pbx is running.The table in database will contain similar to this view inthe... (1 Reply)
Discussion started by: boss
1 Replies

3. Red Hat

helo how to mount pendrive on redhat 9

helo my sysem is running on redhat 9. now i want to take data from redhat 9 pc to pen drive. but when i plug it it is not detected. can u tell me how to mount pendrive on redhat9. amit (1 Reply)
Discussion started by: amitpansuria
1 Replies

4. UNIX for Dummies Questions & Answers

converting a tabular format data to comma seperated data in KSH

Hi, Could anyone help me in changing a tabular format output to comma seperated file pls in K-sh. Its very urgent. E.g : username empid ------------------------ sri 123 to username,empid sri,123 Thanks, Hema:confused: (2 Replies)
Discussion started by: Hemamalini
2 Replies

5. UNIX for Dummies Questions & Answers

helo sftp problem

helo I m creating new user and assigning them to group using my own binary. the entry for /etc/passwd file bhavin:x:2014:109:test:/home/pds_RBAC:/bin/false now when i access that user using sftp from the another linux pc for e.g sftp bhavin@148.147.165.46 passwd:- ****** but... (1 Reply)
Discussion started by: amitpansuria
1 Replies

6. Shell Programming and Scripting

Extract data based on match against one column data from a long list data

My input file: data_5 Ali 422 2.00E-45 102/253 140/253 24 data_3 Abu 202 60.00E-45 12/23 140/23 28 data_1 Ahmad 256 7.00E-45 120/235 140/235 22 data_4 Aman 365 8.00E-45 15/65 140/65 20 data_10 Jones 869 9.00E-45 65/253 140/253 18... (12 Replies)
Discussion started by: patrick87
12 Replies

7. Linux

Changeing helo sent from sendmail

I'm trying to change the helo sent from one of my sendmail servers. It is sending out localhost.localdomain and i need it to send , Every time i change it, my sendmail blows up. It wont send new mail and it gives me the error of Apr 13 17:19:03 localhost sendmail: o3E0J3F2012758: from=root,... (0 Replies)
Discussion started by: blackax
0 Replies

8. Shell Programming and Scripting

Converting variable space width data into CSV data in bash

Hi All, I was wondering how I can convert each line in an input file where fields are separated by variable width spaces into a CSV file. Below is the scenario what I am looking for. My Input data in inputfile.txt 19 15657 15685 Sr2dReader 107.88 105.51... (4 Replies)
Discussion started by: vharsha
4 Replies

9. Shell Programming and Scripting

Parsing XML (and insert data) then output data (bash / Solaris)

Hi folks I have a script I wrote that basically parses a bunch of config and xml files works out were to add in the new content then spits out the data into a new file. It all works - apart from the xml and config file format in the new file with XML files the original XML (that ends up in... (2 Replies)
Discussion started by: dfinch
2 Replies

10. Shell Programming and Scripting

awk --> math-operation in data-record and joining with second file data

Hi! I have a pretty complex job - at least for me! i have two csv-files with meassurement-data: fileA ...... (2 Replies)
Discussion started by: IMPe
2 Replies
TOTAL(1)						      General Commands Manual							  TOTAL(1)

NAME
total - sum up columns SYNOPSIS
total [ -m ][ -sE | -p | -u | -l ][ -i{f|d}[N] ][ -o{f|d} ][ -tC ][ -N [ -r ]] [ file .. ] DESCRIPTION
Total sums up columns of real numbers from one or more files and prints out the result on its standard output. By default, total computes the straigt sum of each input column, but multiplication can be specified instead with the -p option. Likewise, the -u option means find the upper limit (maximum), and -l means find the lower limit (minimum). Sums of powers can be computed by giving an exponent with the -s option. (Note that there is no space between the -s and the exponent.) This exponent can be any real number, positive or negative. The absolute value of the input is always taken before the power is computed in order to avoid complex results. Thus, -s1 will produce a sum of absolute values. The default power (zero) is interpreted as a straight sum without taking absolute values. The -m option can be used to compute the mean rather than the total. For sums, the arithmetic mean is computed. For products, the geomet- ric mean is computed. (A logarithmic sum of absolute values is used to avoid overflow, and zero values are silently ignored.) If the input data is binary, the -id or -if option may be given for 64-bit double or 32-bit float values, respectively. Either option may be followed immediately by an optional count, which defaults to 1, indicating the number of double or float binary values to read per record on the input file. (There can be no space between the option and this count.) Similarly, the -od and -of options specify binary double or float output, respectively. These options do not need a count, as this will be determined by the number of input channels. A count can be given as the number of lines to read before computing a result. Normally, total reads each file to its end before producing its result, but this behavior may be overridden by inserting blank lines in the input. For each blank input line, total produces a result as if the end-of-file had been reached. If two blank lines immediately follow each other, total closes the file and proceeds to the next one (after reporting the result). The -N option (where N is a decimal integer) tells total to produce a result and reset the calculation after every N input lines. In addition, the -r option can be specified to override reinitialization and thus give a running total every N lines (or every blank line). If the end of file is reached, the current total is printed and the calculation is reset before the next file (with or without the -r option). The -tC option can be used to specify the input and output tab character. The default tab character is TAB. If no files are given, the standard input is read. EXAMPLE
To compute the RMS value of colon-separated columns in a file: total -t: -m -s2 input To produce a running product of values from a file: total -p -1 -r input BUGS
If the input files have varying numbers of columns, mean values will certainly be off. Total will ignore missing column entries if the tab separator is a non-white character, but cannot tell where a missing column should have been if the tab character is white. AUTHOR
Greg Ward SEE ALSO
cnt(1), neaten(1), rcalc(1), rlam(1), tabfunc(1) RADIANCE
2/3/95 TOTAL(1)
All times are GMT -4. The time now is 10:35 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy