- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: How to read INPUT from console for the remote ...
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
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
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-08-2011 01:15 PM - edited 08-08-2011 01:21 PM
08-08-2011 01:15 PM - edited 08-08-2011 01:21 PM
How to read INPUT from console for the remote shell !!
Hi
My Requirement is
If any file in directory1 exists in directory2 on the remote machine , then prompt the user for INPUT (for each existing file). Based on the user's INPUT , perform certain action on that file. Please note that the number of files and file names are not fixed.
I tried to use "read" for reading user INPUT, but it does not wait for user's INPUT when used in remote shell. I do not know why it is so?
Is there any way to read the user's INPUT from the console for the remote shell?
Simplified Program(Why read is not waiting for user's INPUT when executed in remote shell)
#!/usr/bin/ksh
cat <<!EOF! | remsh host1 /usr/bin/ksh -
#!/usr/bin/ksh
echo "Enter A character : \c"
read x
echo $x
!EOF!
If you run the above program, then it does not wait for user INPUT.
But My requirement is "To wait for user INPUT"
Could you please let me know the solution?
Thanks,
Biswal
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-08-2011 04:31 PM
08-08-2011 04:31 PM
Re: How to read INPUT from console for the remote shell !!
It actually is waiting for the input but your line
cat <<!EOF! | remsh host1 /usr/bin/ksh -
is already feeding the input to this stream I suppose.
the best way to script this scenario is to write a script on your local machine, as it will need to run on the remote machine, rcp the file over to the remote machine, then run the script on that machine with a remsh command from your local server. This has a better chance of working, although since it has been like a decade I last used remsh, I don't remember the remote execution behavior. So you will need to test it.
And if you don't mind me asking, why aren't you using ssh/scp in this day and age, where security is (or should be) everyone's number one priority ?
UNIX because I majored in cryptology...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-09-2011 04:41 AM
08-09-2011 04:41 AM
Re: How to read INPUT from console for the remote shell !!
>It actually is waiting for the input but your line: cat <<!EOF! | remsh host1 /usr/bin/ksh -
>is already feeding the input to this stream I suppose.
Right, the input comes form the here doc.
I'm not sure reading from /dev/tty would work?