HPE GreenLake Administration
- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: need help with a script
Operating System - HP-UX
1833875
Members
3291
Online
110063
Solutions
Forums
Categories
Company
Local Language
back
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
back
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
Blogs
Information
Community
Resources
Community Language
Language
Forums
Blogs
Topic Options
- 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
06-19-2006 10:34 PM
06-19-2006 10:34 PM
need help with a script
I need help with a script I am trying - I was hoping that someone would have a more elegant solution that what i have come up.
I have 6 files in the following directory -
(named like this)
/tmp/file1
/tmp/file-2
/tmp/file-3
/tmp/file-4
/tmp/file-5
/tmp/file-6
Each file contains the following:
Tue Jun 20 2006 06:30AM EDT 0.66
I need to open each file - grab the last field (0.66) - sum it with all of the numbers out of the other files- take an average- and place the average in a separate file.
I had done it by using, cat, awk, assigning the number to variable, and then adding all of up and dividing by 6.
I am a beginner at shell scripting so I am sure there is a more "elegant" way to do this, and I would be very interested to see other perspectives.
I have 6 files in the following directory -
(named like this)
/tmp/file1
/tmp/file-2
/tmp/file-3
/tmp/file-4
/tmp/file-5
/tmp/file-6
Each file contains the following:
Tue Jun 20 2006 06:30AM EDT
I need to open each file - grab the last field (0.66) - sum it with all of the numbers out of the other files- take an average- and place the average in a separate file.
I had done it by using, cat, awk, assigning the number to variable, and then adding all of up and dividing by 6.
I am a beginner at shell scripting so I am sure there is a more "elegant" way to do this, and I would be very interested to see other perspectives.
1 REPLY 1
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-19-2006 10:38 PM
06-19-2006 10:38 PM
Re: need help with a script
Double submission ....
The opinions expressed above are the personal opinions of the authors, not of Hewlett Packard Enterprise. By using this site, you accept the Terms of Use and Rules of Participation.
Company
Events and news
Customer resources
© Copyright 2025 Hewlett Packard Enterprise Development LP