- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: Automatic response in shell 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
Discussions
Discussions
Discussions
Forums
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
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-17-2003 12:44 AM
тАО04-17-2003 12:44 AM
I am creating a Unix shell script to execute a command. The script is executed by root ID. However before I can execute a command, I need to change the user ID which is hnmadm. In the script I added a line "su - hnmadm". Unfortunately, it prompted me 2 questions require me to input:
Use Default Diplay <<10.200.64.100>> (y/n)?
Do you wish to start Net Bos Menu (y or n)?
The first question I would like to answer "y" and the second question I would answer "n".
How can I actually pass in the answer to the script so it will not halt waiting for response?
You assistance and advice is very much appreciated. Thank you.
Regards,
Melvin
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-17-2003 12:48 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-17-2003 01:03 AM
тАО04-17-2003 01:03 AM
Re: Automatic response in shell script
If you don't need that user's .profile to be run you can omit the dash (-) from the su command. Of course, you will then have to manually configure the environment if parts of it are needed.
regards,
Darren.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-17-2003 03:47 AM
тАО04-17-2003 03:47 AM
Re: Automatic response in shell script
I use it to automatically telnet to other servers, export my display and launch applications for me. I find this very useful.
Once expect is installed you simply type:
autoexpect -f
when you are done the
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-17-2003 04:34 AM
тАО04-17-2003 04:34 AM
Re: Automatic response in shell script
By protecting the interactive commands (if interactive then...) jobs like cron and other scripts can change user and run without pausing or getting the ubiquitous error message: not a typewriter.
Bill Hassell, sysadmin
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-17-2003 04:47 AM
тАО04-17-2003 04:47 AM
Re: Automatic response in shell script
command | yes or command | no