Telnet shellscript


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Telnet shellscript
# 1  
Old 03-06-2016
Telnet shellscript

Code:
cat << EOF | telnet alt1.aspmx.l.google.com 25
HELO verify-email.org
MAIL FROM: <check@verify-email.org>
RCPT TO: <test@gmail.com>
quit
EOF

Hello, I'm trying to get the result of that execution, and can not see the result or bring it to a txt ... the direct command in ssh running the result perfectly ... can someone help me to view or save to log.

Thank you.

Last edited by Scrutinizer; 03-06-2016 at 04:07 PM.. Reason: code tags
# 2  
Old 03-06-2016
What command do you run with ssh then?
# 3  
Old 03-06-2016
Code:
telnet alt1.aspmx.l.google.com 25
HELO verify-email.org
MAIL FROM: <check@verify-email.org>
RCPT TO: <test@gmail.com>
quit
root@san [~]# telnet alt1.aspmx.l.google.com 25
Trying 2a00:1450:4010:c09::1a...
Connected to alt1.aspmx.l.google.com.
Escape character is '^]'.
220 mx.google.com ESMTP qm6si6508388lbb.110 - gsmtp
HELO verify-email.org
250 mx.google.com at your service
MAIL FROM: <check@verify-email.org>
250 2.1.0 OK qm6si6508388lbb.110 - gsmtp
RCPT TO: <test@gmail.com>
550-5.1.1 The email account that you tried to reach does not exist. Please try
550-5.1.1 double-checking the recipient's email address for typos or
550-5.1.1 unnecessary spaces. Learn more at
550 5.1.1  https://support.google.com/mail/answer/6596 qm6si6508388lbb.110 - gsmtp
quit
221 2.0.0 closing connection qm6si6508388lbb.110 - gsmtp
Connection closed by foreign host.


Last edited by Don Cragun; 03-07-2016 at 05:07 AM.. Reason: Remove duplicated B tags, change ICODE tags to CODE tags, & add CODE tags.
# 4  
Old 03-07-2016
Did you consider redirecting stderr?
# 5  
Old 03-07-2016
Code:
 sh aa 1> aa.txt 2>&1

OR

sh aa &> aa.txt

cat aa.txt
Trying 2a00:1450:4010:c09::1a...
Connected to alt1.aspmx.l.google.com.
Escape character is '^]'.
Connection closed by foreign host.

Trying 2a00:1450:4010:c09::1a...
Connected to alt1.aspmx.l.google.com.
Escape character is '^]'.
Connection closed by foreign host.

Response codes the not arrive, it is that they need but can not see

thank you so much.
# 6  
Old 03-10-2016
hello, can someone help me? Thank you.
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Help with shellscript

I am new in shell script i want to convert .txt file in the format axsjdijdjjdk to a x s j d i j d j j d k (5 Replies)
Discussion started by: sreejithalokkan
5 Replies

2. UNIX for Dummies Questions & Answers

Difference Between Krb5-telnet And Ekrb5-telnet

Hi, I want to know the difference between these two services. Both are under xinetd. Both are used for enabling and disabling Telnet service. So, can somebody please explain me the difference between the two ? Thanks in advance :) (0 Replies)
Discussion started by: kashifsd17
0 Replies

3. Shell Programming and Scripting

Shellscript Reengineering

Dear Community, I've an urgent issue due to a migration of an application from HP-Unix to Linux. We have a mass of scripts which are running at a dedicated server on hpunix. Now we do not know, which further scripts exists on this machine. the idea is, that we crawl through the scripts we... (1 Reply)
Discussion started by: Alibapir
1 Replies

4. UNIX for Dummies Questions & Answers

Automatically login in the telnet from present telnet

Hi, I was writing one script which includes to switch to the another telnet automatically from the present telnet server. I was using rlogin but firstly it takes the same user name of the present telnet and secondly it is prompting for the password. But i want to switch to the another telnet... (2 Replies)
Discussion started by: Prateek
2 Replies

5. Shell Programming and Scripting

Webpage to Telnet via Perl and Expect: Telnet problem?

Somewhat long story: I have a simple Perl CGI script that uses Expect to Telnet to a device and grab some data, and then spits it back to Perl for display on the Webpage. This works for many devices I've tried, but one device just fails, it keeps rejecting the password on this device, only... (1 Reply)
Discussion started by: jondo
1 Replies

6. Shell Programming and Scripting

Need help with shellscript

Hello. I am a novince at writing shell scripts but here is the question. I have to write a shell script that does the following: Once executed via crontab, the script should do the following: a. get date/time stamp in for format 10-MAR-05 and b. execute shell script my_script.sh (which... (2 Replies)
Discussion started by: jigarlakhani
2 Replies

7. Programming

Shellscript for MQSeries

Iam new to shellscript. 1)How to strart QUERYMANAGER using shellscript. 2)How to put and get messages in MQSeries using shellscripts. 3)iam using local queues . Thanks lot. (0 Replies)
Discussion started by: ram2s2001
0 Replies

8. UNIX for Dummies Questions & Answers

Shellscript Interpreting

I am trying to interpret the following shellscript and am having a very difficult time. Could one of you Unix gurus pleasssseeee help me out? You just won't know how much of a life saver you would be for me. PN=`basename "$0"` # Program name VER=`echo '$Revision: 1.2 $' | cut -d' ' -f2` ... (3 Replies)
Discussion started by: Ann
3 Replies

9. Shell Programming and Scripting

Create Shellscript

I am new to UNIX. I got the file from Oracle, with two columns (Table Name and Column Name). I need to create the shell script where the result suppose to include plain text, <table_name>, <Column_name> from the file. Plain text will be the statements to create index in Oracle. something like... (1 Reply)
Discussion started by: newuser100
1 Replies
Login or Register to Ask a Question