HPE GreenLake Administration
- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- need script to provide program user repsonse
Operating System - HP-UX
1836866
Members
2291
Online
110110
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
05-06-2005 02:42 AM
05-06-2005 02:42 AM
need script to provide program user repsonse
I have this program which needs to be called repeatedly with different arguments. The program itself eventually asks the user to answer yes or no to a question.
I have written a script which repeatedly calls the program with different arguements, no problem. But it is possible for me to know the answer to the yes or no question ahead of time. So I'd like the script to provide the user's repsonse automatically. Basically if I know the answer will always be yes each time the program is called, when the program has stopped and is waiting on the user input I want the script to respond with yes.
Any examples?
Thanks,
Rick
I have written a script which repeatedly calls the program with different arguements, no problem. But it is possible for me to know the answer to the yes or no question ahead of time. So I'd like the script to provide the user's repsonse automatically. Basically if I know the answer will always be yes each time the program is called, when the program has stopped and is waiting on the user input I want the script to respond with yes.
Any examples?
Thanks,
Rick
2 REPLIES 2
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-06-2005 02:46 AM
05-06-2005 02:46 AM
Re: need script to provide program user repsonse
I would look at using Expect for something like this.
Expect allows you to respond depending on the prompt that is presented.
http://hpux.connect.org.uk/hppd/hpux/Tcl/expect-5.43/
Expect allows you to respond depending on the prompt that is presented.
http://hpux.connect.org.uk/hppd/hpux/Tcl/expect-5.43/
- Tags:
- expect
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-06-2005 02:58 AM
05-06-2005 02:58 AM
Re: need script to provide program user repsonse
Well 'expect' is one tool that you can use. But since there is only one point of user interaction you can use pipe (|)
$ echo yes | <script>
You can even capture the results if you want.
$ x=`echo yes | <script>`
$ echo $x
$ echo yes | <script>
You can even capture the results if you want.
$ x=`echo yes | <script>
$ echo $x
- Tags:
- redirect
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