- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Scripting question
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
09-02-2008 02:56 AM
09-02-2008 02:56 AM
This is quite an obscure question but would love to know how to do this. If I am writing a script which is interactive I want to show that the script is processing at certain points. In otherwords for example the script will say "Gathering Info....." what I wanted to know is how can I show the script is processing such as adding an additional dot every 10 secs. I hope this makes sense.
Cheers
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-02-2008 03:24 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-02-2008 03:31 AM
09-02-2008 03:31 AM
Re: Scripting question
To create a progress bar (dots, a spinning widget, etc.) in a shell script, you build a function that paints the bar with small sleep intervals between each point. You launch this piece as a background task while processing to do the real work of your script. When the real work is done, you kill the background process having captured its pid when you launched it.
Regards!
...JRF...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-02-2008 04:39 AM
09-02-2008 04:39 AM
Re: Scripting question
You can use "kill -0 $SAVE_PID" (where you saved $! from the background job) to know when to quit the loop.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-02-2008 05:28 AM
09-02-2008 05:28 AM
Re: Scripting question
If that helps your end users feeling better about the system, then fine.
Personally I would want to see honest progress otherwise I still need to resort to top or ps | grep to 'see' that it might be working.
Maybe a dot for each 10O MB processed? Or every 100 files compiled, every 1000 primes calculated, every 10,000 IOs does, every 5 seconds CPU burned, or whatever the task on hand might be
fwiw,
Hein.