- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Scripting interactive command.
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
02-24-2006 01:19 AM
02-24-2006 01:19 AM
Scripting interactive command.
nid TARGET=sys/password@TSH1 DBNAME=TSH2
But this command runs interactively and asks me to enter (Y/[N]) as follows:
Change database ID and database name TSH1 to TSH2? (Y/[N]) =>
I scripted it in a file to pass the value 'Y' as follows:
#!/usr/bin/sh
ORACLE_SID=TSH1 ; export ORACLE_SID
nid TARGET=sys/password@TSH1 DBNAME=TSH2
Y
exit 0
But it didn't work, still asks me:
Change database ID and database name TSH1 to TSH2? (Y/[N]) =>
How to pass 'Y' in the script?
Thanks,
Gulam.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-24-2006 01:21 AM
02-24-2006 01:21 AM
Re: Scripting interactive command.
have you tried a redirect?
echo "Y" > answers.lis
nid TARGET=sys/password@TSH1 DBNAME=TSH2 < answers.lis
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-24-2006 01:29 AM
02-24-2006 01:29 AM
Re: Scripting interactive command.
You can try the here doc:
#!/usr/bin/sh
ORACLE_SID=TSH1 ; export ORACLE_SID
nid TARGET=sys/password@TSH1 DBNAME=TSH2 <
exit
EOF
Cheers,
Renarios
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-24-2006 01:30 AM
02-24-2006 01:30 AM
Re: Scripting interactive command.
#!/usr/bin/sh
ORACLE_SID=TSH1 ; export ORACLE_SID
nid TARGET=sys/password@TSH1 DBNAME=TSH2 << EOF
Y
EOF
exit 0
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-24-2006 03:30 AM
02-24-2006 03:30 AM
Re: Scripting interactive command.
Yep the answer is Here statemnet.
Follow Patricks instruction. Note there should be a space between "<<" and "EOF". secondly the exit should be after the second EOF, as it is not a response your nid program awaits.
Regards,
Senthil Kumar .A
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-24-2006 03:44 AM
02-24-2006 03:44 AM
Re: Scripting interactive command.
#!/usr/bin/sh
ORACLE_SID=TSH1 ; export ORACLE_SID
nid TARGET=sys/password@TSH1 DBNAME=TSH2 << EOF
Y
EOF
For more info about here-document:
http://wks.uts.ohio-state.edu/unix_course/intro-110.html
HTH,
Art
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-24-2006 04:40 AM
02-24-2006 04:40 AM
Re: Scripting interactive command.
http://hpux.ee.ualberta.ca/hppd/hpux/Tcl/expect-5.43/
I attached a sftp expect script
Rgds...Geoff