- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Adding totals in a file
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Discussions
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-12-2002 06:15 AM
05-12-2002 06:15 AM
I've got an issue with a disk array - I have attempted to backthe data up in vg02 from the array. fbackup appeared to hang, i killed the processes, checked the tape index and appear to have a whole load of data on the tape - how much is the question. The usage of vg02 is 3.5 gig - if I grep a file from the index i can see the file and it's size. I have printed column 1 from the index ( file sizes ) and output to another file.
How can I add the total of all the lines in the file to get a calculation of how much data if have managed to back up, ie
12345
12345
12345
= 37035
Regards
Steve
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-12-2002 06:25 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-12-2002 06:33 AM
05-12-2002 06:33 AM
Re: Adding totals in a file
As in
cat file | awk 'BEGIN {total=0;} {total=total+$1;} END {print total,"\n";}'
This gives
3.83543e+09
Excuse me if the above is correct - could you explain the output
Thanks
Steve
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-12-2002 06:38 AM
05-12-2002 06:38 AM
Re: Adding totals in a file
The sum is in scientific notation. Hence, "e+09" means multiply by 10^9 ( or shift the decimal place 9-times to the right). In your example:
3.83543e+09 = 3,835,430,000
Regards!
...JRF...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-12-2002 06:41 AM
05-12-2002 06:41 AM
Re: Adding totals in a file
Thanks guys
Looks like I have all the data on the tape
Regards
Steve
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-12-2002 02:18 PM
05-12-2002 02:18 PM
Re: Adding totals in a file
Use this:
cd /var/tmp
frecover -I /var/tmp/fbfiles -f /dev/rmt/
tail /var/tmp/fbfiles(find the last file on the backup)
frecover -xmF -f /dev/rmt/ -i /whatever_the_last_file_is
If it restores OK, then all the previous files are likely OK.
Bill Hassell, sysadmin