- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- How to pause a script
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
04-08-2003 04:44 AM
04-08-2003 04:44 AM
Anyone any idea how to build a pause into a shell-script.
I know, bad example, but Windows command "pause" says: "Press any key to continue" I'dd like to make it work within a shell script as well.
pause within unix is a C-call, so I can't use it. Thanks for your help in advance.
Regs David
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-08-2003 04:45 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-08-2003 04:47 AM
04-08-2003 04:47 AM
Re: How to pause a script
use
read
Chris
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-08-2003 04:50 AM
04-08-2003 04:50 AM
Re: How to pause a script
This will work:
# echo "Press Enter to continue...\c"
# read BITBUCKET
...or if you merely wish to "pause" for some number of seconds"
# echo "waiting a bit..."
# sleep 10
...or an HP extension:
# echo "waiting 10 seconds or your response"
# REPLY=`line -t 10`
...in the above, REPLY will be empty if you don't respond in 10-seconds. Otherwise it will be equivalent to a 'read REPLY'.
Regards!
...JRF...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-08-2003 04:53 AM
04-08-2003 04:53 AM
Re: How to pause a script
that's a really great answer for a kinda simple question.
Gotta learn that from you.
- ramd.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-08-2003 05:08 AM
04-08-2003 05:08 AM
Re: How to pause a script
This looks very good.
Never knew the REPLY one, great !!
Everybody else, thanks for your quick response !
Regs David
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-08-2003 05:10 AM
04-08-2003 05:10 AM
Re: How to pause a script
I agree with everyone, but I have to mention that James answer is a good one. I will add that one to my collection.
Regards,
DR
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-08-2003 05:23 AM
04-08-2003 05:23 AM
Re: How to pause a script
I would be remiss if I didn't point out that the man pages for 'line' make this warning:
"This command is likely to be withdrawn from X/Open standards. Applications using this command might not be portable to other vendors' systems. As an alternative read is recommended."
Regards!
...JRF...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-08-2003 05:44 AM
04-08-2003 05:44 AM
Re: How to pause a script
Many thanks mister Olympian! :)
Regs David
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-10-2003 05:43 AM
04-10-2003 05:43 AM
Re: How to pause a script
....
echo "Choose:y|n \c"
RET=`((sleep 20; echo timeout)& cat -u 2>&-) | (read xxx;echo "$xxx")`
fi
case $RET in
y|Y) do_something ;;
n|N) do_somthing ;;
timeout ) default ;;
esac
......
That about the same as line -t