- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - Linux
- >
- scripting
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
12-04-2007 08:58 AM
12-04-2007 08:58 AM
Need a help on a script. I have explorer script which i need to automate. The script basically collects information about server hardware software etc.
I need to provide inputs to the script (need to automate this with another script). The script needs just an "enter" (to accept the default) for all the Questions that it asks. Is there a way that i can provide the input ("enter" i.e echo -e "/r") to the script in a loop etc whenever it asks for input.
Regards,
SaC
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-04-2007 09:32 AM
12-04-2007 09:32 AM
Re: scripting
you have a interactive script ( say explorer.sh) which requires some input at runtime.
you want a way to run this script and leave it unattended and also want the input to be give automatically.
as the default value is taken when enter is pressed.
create a file which has as many lines as there are inpupts/questions in script. say the name of the file is default_input.txt
exceute your script in while loop as
while true
do
explorer.sh < default_input.txt
done
Thanks
Sri
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-04-2007 09:56 AM
12-04-2007 09:56 AM
Re: scripting
So my requirement is, when the script needs input it takes input from input.txt and finally when done shud exit.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-04-2007 09:59 AM
12-04-2007 09:59 AM
Solutionecho "Enter the value for HELLO"
read HELLO
if [ -z "$HELLO" ]
then
HELLO=default
fi
echo $HELLO
echo "Enter the value for GOODBYE"
read GOODBYE
if [ -z "$GOODBYE" ]
then
GOODBYE=default
fi
echo $GOODBYE
Running in this way:
touch answer
./script < answer
It accepts all the default values.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-04-2007 10:23 AM
12-04-2007 10:23 AM
Re: scripting
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-04-2007 06:25 PM
12-04-2007 06:25 PM
Re: scripting
Seems that I was not able to convay it properly. sorry for my poor english.
neways the problem is solved :).