- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - Linux
- >
- [ How to make script to read inputs from a file ]
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
10-03-2005 04:05 PM
10-03-2005 04:05 PM
I have script which has no support for inputs from a file. But i use script with same values all the time.
Hence i would like to put all my answers for all queries of script in a file and want to supply it.
What is the best way to do this, with minimum changes. I would like to know is it possible to close file handle and duplicate stdin for my file.
Thanks,
Madhava
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-03-2005 04:14 PM
- Tags:
- redirect
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-03-2005 04:17 PM
10-03-2005 04:17 PM
Re: [ How to make script to read inputs from a file ]
while read i
do
myscript $i
done
- Tags:
- while loop
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-03-2005 04:27 PM
10-03-2005 04:27 PM
Re: [ How to make script to read inputs from a file ]
If i redirect input from a file will the script understand the format or we need to take care of checking each entry?
My doubt is if i put all responses on seperate lines will script parses it correctly and gives inputs to queries in script.
Thanks,
Madhava
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-03-2005 04:34 PM
10-03-2005 04:34 PM
Re: [ How to make script to read inputs from a file ]
-Arun
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-03-2005 05:12 PM
10-03-2005 05:12 PM
Re: [ How to make script to read inputs from a file ]
I am getting problem with script during only password reading portion.
Other than script is able to read line by line for each input required.
Thanks,
Madhava
- Tags:
- Password
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-03-2005 05:26 PM
10-03-2005 05:26 PM
Re: [ How to make script to read inputs from a file ]
-Arun
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-03-2005 05:28 PM
10-03-2005 05:28 PM
Re: [ How to make script to read inputs from a file ]
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-03-2005 05:40 PM
10-03-2005 05:40 PM
Re: [ How to make script to read inputs from a file ]
--- configuration.ksh ----
name=madhavbk
day="Oct 5"
--- script.ksh ---
. ./configuration.ksh
echo $name
echo $day
.
It is like a header file inclusion in ksh scripting.
hth.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-03-2005 11:07 PM
10-03-2005 11:07 PM
Re: [ How to make script to read inputs from a file ]
For all password requests when there is echo off for stty script is not reading password from file.
All other entries it is taking correctly.
Any clues.
Following is the error message.
stty: : Not a typewriter
Thanks,
Madhava
- Tags:
- stty
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-03-2005 11:10 PM
10-03-2005 11:10 PM
Re: [ How to make script to read inputs from a file ]
http://forums1.itrc.hp.com/service/forums/questionanswer.do?threadId=891850
hth.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-03-2005 11:11 PM
10-03-2005 11:11 PM
Re: [ How to make script to read inputs from a file ]
http://docs.hp.com/en/B2355-90046/ch21s04.html
[Shells: User's Guide > Chapter 21. Basic Shell Programming Data Input and Output]
http://forums1.itrc.hp.com/service/forums/questionanswer.do?threadId=944865
http://forums1.itrc.hp.com/service/forums/questionanswer.do?threadId=35433
-Arun
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-03-2005 11:12 PM
10-03-2005 11:12 PM
Re: [ How to make script to read inputs from a file ]
http://forums1.itrc.hp.com/service/forums/questionanswer.do?threadId=72142
hth.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-03-2005 11:21 PM
10-03-2005 11:21 PM
Re: [ How to make script to read inputs from a file ]
The error is because, it expacts ainteractive terminal and it does not get one.
if tty -s
then
INTERACTIVE=/sbin/true
else
INTERACTIVE=/sbin/false
fi
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-04-2005 02:30 AM
10-04-2005 02:30 AM
Re: [ How to make script to read inputs from a file ]
Reading passwords really has nothing to do with echo off or on. It depends on which passwords you are trying to read and what routines are actually being used but in almost all cases, stdin is not the source of input for the password read. Those are almost always read using another file descriptor. In general, you must use a tool like expect (which does handle multiple file descriptors) to process complicated password entry. You can get expect from any of the HP-UX Porting Centre's.
- Tags:
- expect