- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: Scripting issue where it wants a tty
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
Discussions
Discussions
Forums
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
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
тАО03-07-2002 08:41 AM
тАО03-07-2002 08:41 AM
Re: Scripting issue where it wants a tty
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-07-2002 09:23 AM
тАО03-07-2002 09:23 AM
Re: Scripting issue where it wants a tty
Example:
My_tool <
logoff user=myuser
ENDIT
Still get the no tty error wherever I direct the output.
Seems to me I need to trick the input somehow so it thinks I'm on a tty or /dev/console, etc, but I'm not sure if that's possible.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-07-2002 09:54 AM
тАО03-07-2002 09:54 AM
Re: Scripting issue where it wants a tty
My_tool <
logoff user=myuser >/dev/tty 2>&1
ENDIT
HTH
mark
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-07-2002 10:33 AM
тАО03-07-2002 10:33 AM
Re: Scripting issue where it wants a tty
Lateral thinking
Run a cronjob on another server to telnet to the server with the script - login and fire up the script and when finished leave.
Paula
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-07-2002 12:11 PM
тАО03-07-2002 12:11 PM
Re: Scripting issue where it wants a tty
Paula, thanks. Your idea was was my final option, which should work. In fact, I could even use the cron on the server itself to use expect and then telnet back to itself. I don't really like this idea because I'd have to put the password in the script and its very unelegant. But it should work and if I really need to automate this, its probably my only choice left. When I get the time to install TCL/TK/expect I'll give this a try.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-07-2002 02:01 PM
тАО03-07-2002 02:01 PM
Re: Scripting issue where it wants a tty
If it's a shell script, it may be possible to circumvent the tty restriction without actually providing a tty and without modifying the script. Examine the script and look for the use of the commands tty or pty.
If it's a POSIX shell script, then it may check like this:
tty || exit
if tty -s
then
continue()
else
echo "Not a tty"
fi
if ! tty -s
then
echo "Not a tty"
exit
fi
if [ -t 0 ]
then
echo "You are out of luck here"
exit
fi
If it is using tty or pty, alias them to true or false (whichever is appropriate) before sourcing the script:
alias tty=true
. script <
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-07-2002 02:14 PM
тАО03-07-2002 02:14 PM
Re: Scripting issue where it wants a tty
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-08-2002 08:02 AM
тАО03-08-2002 08:02 AM
Re: Scripting issue where it wants a tty
just a thought,
mark
btw, which vendor?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-08-2002 09:16 AM
тАО03-08-2002 09:16 AM
Re: Scripting issue where it wants a tty
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-08-2002 09:25 AM
тАО03-08-2002 09:25 AM
Re: Scripting issue where it wants a tty
After reading all this, I can see two options:
Plan A: Relatively easy but messy (and you've already mentioned it) Loop output from one tty port to another.
Plan B: Elegent but technically difficult. Write and install a pseudo-tty device driver so that the isatty(0) function returns 0 and thus the application thinks stdin is a tty device (because it is). The idea is that your can write to this pseudo device and store your input and then the read read from the buffer.
I did have to do something very much like this many years ago but I haven't done it in the HP-UX world.
Food for thought, Clay