- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: Program reading input from terminal (I need to...
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
08-11-2000 07:59 AM
08-11-2000 07:59 AM
Program reading input from terminal (I need to read from file or standard in)
Any ideas?
Thanks,
Carey Goad
carey.goad@dobson.net
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-11-2000 08:11 AM
08-11-2000 08:11 AM
Re: Program reading input from terminal (I need to read from file or standard in)
if [ some condition ]
then
echo "Enter filename"
read filename
else
filename=$1
fi
Read can get input from a file or pipe used as standard input:
shellcommand < file
or
command|shellcommand
while read inputline
do
process inputline
done
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-11-2000 08:19 AM
08-11-2000 08:19 AM
Re: Program reading input from terminal (I need to read from file or standard in)
cat - << EOINPUT | your_vendors_program
what the terminal would have input
somemore
EOINPUT
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-11-2000 08:22 AM
08-11-2000 08:22 AM
Re: Program reading input from terminal (I need to read from file or standard in)
Thanks for the ideas
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-11-2000 09:06 AM
08-11-2000 09:06 AM
Re: Program reading input from terminal (I need to read from file or standard in)
Just thoughts...
What about if your vendors program was based on reading specificaly terminal input, why not try to output your file to the terminal like cat
Yours Victor
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-11-2000 10:39 AM
08-11-2000 10:39 AM
Re: Program reading input from terminal (I need to read from file or standard in)
your_vendor_program |&
while read -p line
do
case $line in
"this is something I'll reply to") print -p "my respondance";;
*) continue;;
esac
done
be sure the lines you respond to are somewhat unique. At least to the point that you want to give the same answer every time.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-14-2000 01:45 AM
08-14-2000 01:45 AM
Re: Program reading input from terminal (I need to read from file or standard in)
process < file
then your program must be open your tty, so you can try try:
tty= `tty`
(sleep 1; cat file > $tty ) & process
Im not sure of syntax. The idea is feed tty whith your file.
Other:
Use glance -> proces list-> open files to see what files opens you process.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-14-2000 01:56 AM
08-14-2000 01:56 AM
Re: Program reading input from terminal (I need to read from file or standard in)
It sounds as though your application insists on talking to the terminal - as does the passwd command.
It may be worth your while checking out 'expect' which with its dependencies tcl-8.2.1 and tk can be downloaded from your friendly neighbourhood HP Porting Centre.
Ours is http://hpux.connect.org.uk/hppd/hpux/
Quote from the porting centre:-
Expect 5.31
Allows programmed dialogue with interactive programs. Makes use of a scripting language. Can be used to automate tasks that require certain interactive responses. Requires Tcl 8.0p2, which is available in this category and can also use tk 8.0p2.
Regards,
John