Visit Our UNIX and Linux User Community

telnet issue

Thread Tools Search this Thread
Top Forums Shell Programming and Scripting telnet issue
# 8  
Old 11-15-2007
You could pipe in the "cp" command as stdin to the ssh command rather than have it on the command line.

/usr/local/bin/ssh <<EOF 
cp -R "/bp01/secftp/samsun/prfile/FTP/REFUND_RESTATEMENT_REPORTS/poirty/Production/Internal/mail rpt" /bp01/secftp/samsun/prfile/FTP/REFUND_RESTATEMENT_REPORTS/poirty/Production/Internal/Archive/

# 9  
Old 11-15-2007
Have you mispelt "priority"?
# 10  
Old 11-16-2007
thanks for that...i will cross check priority

Could you please tell how to pipe cp with sh

another thing if i am not providing enough sleep it is exiting

thanks again

Originally Posted by porter
Have you mispelt "priority"?
# 11  
Old 11-16-2007
Originally Posted by sam99
Could you please tell how to pipe cp with sh
I did, that is the example with <<EOF ... EOF

Originally Posted by sam99
another thing if i am not providing enough sleep it is exiting
No, you shouldn't have to do *any* sleeping. As a general rule if you are doing comms code and you have to have sleeps you have got something wrong(1). Telnet or ssh or rcmd or rsh should not return control until the command at the far end has completed. If you pipe in a thousand commands, they will sit in the pipe line and be diligently executed one at a time in sequence unless you do something fancy with jobs or "&".

1. I'm not talking about retry timeouts at lower protocols.
# 12  
Old 11-16-2007
please find below the script...
it is not echoing scp_cmd2 and logging out without sleep.....


scp_cmd1="/usr/local/bin/ssh -v << EOF"
scp_cmd2="cp -R "$dir_path/mail rpt" $dir_path/Archive"

echo open $Infahost
sleep 1
echo $Infaftplogin
sleep 1
echo $Infaftppasswd
sleep 1
echo $scp_cmd1
sleep 5
echo $scp_cmd2
sleep 5
echo $scp_cmd3
sleep 5


Previous Thread | Next Thread
Test Your Knowledge in Computers #362
Difficulty: Medium
The sed command first appears in Version 5 AT&T UNIX.
True or False?

10 More Discussions You Might Find Interesting

1. UNIX for Beginners Questions & Answers

Telnet issue

In the below script, i want to check telnet port status of list of servers, here where ever port working i am getting output. where ever port is not working (where ever trying) there it's command stuck, there it's needed manual interruption like ctrl+c. without interception i want run this... (1 Reply)
Discussion started by: rajiv
1 Replies

2. Red Hat

Telnet issue

Hi All! for lab purposes i need to run telnet server on my RedHat 7 machine. i installed the package: telnet-server using yum. i read that i need to edit the telnet file under /etc/xinetd.d the problem is that there is no telnet file in that folder. the telnet server install completed... (9 Replies)
Discussion started by: guy3145
9 Replies

3. Linux

Infuriating Telnet Issue

Hi, Recently I've been working a lot with telnet for various reasons (obsolete, I realise). However, I've run into an issue. With most telnet clients, login is possible. However, with a few, typing is possible until I try to hit enter. For example, I try to type "admin" as the username and... (5 Replies)
Discussion started by: FreddoT
5 Replies

4. Solaris

Telnet issue

Hi Gurus, I have solaris 10 server where I can telnet to one host and port <20011> with no problem..but when I am trying to telnet to another host same port (port is listening) I am not getting any just says trying.... Now that I have both hosts listed in the /etc/hosts file,... (4 Replies)
Discussion started by: mohullah
4 Replies

5. UNIX for Dummies Questions & Answers

Goofy telnet issue

Greetings! My name is Jerry. I am a long time IBM i-series (AS/400) admin. I am the solo IT guy at a $50M company, we run mostly Windows servers on virtual machines, I do have one i-series, and one p-series. Recently, we have decided to go with a legacy product that is proven and bulletproof, it... (0 Replies)
Discussion started by: jeveretts
0 Replies

6. Shell Programming and Scripting

perl telnet issue with cisco

Hi Experts, I am using perl to telnet on cisco boxes. We have this stupid cisco node which does not support "terminal Length0" command. Since I am using Net::Telnet and capturing output with @output = $telnet->cmd('cmd'); Say @output = $telnet->cmd('show version'); Now problem... (2 Replies)
Discussion started by: mtomar
2 Replies

7. Solaris

issue regarding telnet on solaris(9 version)

hi this is hrushi i have issue regarding solaris(9 version) when i telnet from solaris to linux machine it displaying message like connection closed by forine host ...when i telnet from linux to solaris its working fine me its urgent and i'm new to solaris 9 (2 Replies)
Discussion started by: ghrushi84
2 Replies

8. Shell Programming and Scripting

urgent help needed in telnet issue

Hi, Whenever i am trying to telnet to server i am getting frequent error Authorized Login: prtsrc's Password: /dev/pts/171: Password read timed out -- possible noise on port when i am rerunning the same it is working fine thanks, sam (2 Replies)
Discussion started by: sam99
2 Replies

9. Shell Programming and Scripting

Reg : telnet password issue

Hi All, I am working on AIX 5.3. My requirement is to telnet to a server and scp a file from another server In my shell script i am using telnet to enter to a server and i am echoing the password as below echo open $Infahost sleep 1 echo $Infaftplogin sleep 1 echo $Infaftppasswd... (3 Replies)
Discussion started by: sam99
3 Replies

10. Solaris

Telnet issue E5500/V480

Our old E5500 was just turned off (planned :rolleyes: ) and the application was moved to a V480. Now if I login to the V480 and try to sudo to root my connection hangs, and I can not telnet to the E5500 after it was powered on again. I get "connection refused". Telnet to this machine was... (5 Replies)
Discussion started by: kjbaumann
5 Replies

Featured Tech Videos