- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- run the program with batch mode
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
01-26-2005 07:57 PM
01-26-2005 07:57 PM
run the program with batch mode
I have installed a program (eg. programA ), if the user run the program , it will ask the user to answer some questions ( assume all the answers are "yes" ), for simplier , is it possible to answer all the questions automatically by a batch mode ? so that the user no need to input many many times of "yes" thx in advance.
eg.
#run programA < answer.txt , where answer.txt contain the word "yes" .
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-26-2005 08:05 PM
01-26-2005 08:05 PM
Re: run the program with batch mode
If you run the program from a script, you should be able to do something like this:
#----- start of script -----
#!/bin/ksh
/myprogram <
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-26-2005 08:52 PM
01-26-2005 08:52 PM
Re: run the program with batch mode
but be careful if the program you are calling is rm.
I just tried:
touch a.txt
chmod 444 a.txt
ll a.txt
rm a.txt << !
n
!
ll a.txt
AND THE FILE HAD BEEN REMOVED !
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-26-2005 09:26 PM
01-26-2005 09:26 PM
Re: run the program with batch mode
Keith
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-26-2005 09:40 PM
01-26-2005 09:40 PM
Re: run the program with batch mode
I tried the same rm from the command line and it responded with:
a.txt: 444 mode ? (y/n)
My note was purely a by-the-way, your solution is absolutely correct ;-)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-26-2005 09:52 PM
01-26-2005 09:52 PM
Re: run the program with batch mode
No worries. My rm doesn't behave like that by default, maybe we are using different flavours of Unix (I know Linux prompts for everything!).
Anyway, peter(chu) hope this has sorted your problem.
All the best - Keith
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-30-2005 02:28 PM
01-30-2005 02:28 PM
Re: run the program with batch mode
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-30-2005 09:11 PM
01-30-2005 09:11 PM
Re: run the program with batch mode
If all the user inputs are going to be "yes", then why should the script ask a question, in the first place?
Your script can be made to run with all the "yes" conditions as the assumed answer.
WIth regards,
Mohan.