Sponsored Content
Full Discussion: Telnet using shell Scripting
Top Forums Shell Programming and Scripting Telnet using shell Scripting Post 302631297 by akrati1 on Friday 27th of April 2012 07:43:16 AM
Old 04-27-2012
Question Telnet using shell Scripting

i have written a script as shown below :

Code:
telnet 10.161.240.2 8100
<?xml version="1.0"?> <login_command> <sequence id="1" /> <access  id="1"/> <user name = "user1" password = "pass"/> </login_command> 
<?xml version="1.0"?> <RegistrationDescriptor> <sequence id="1" /> <access    id="1"/> <attributeDescriptors> <action>Register</action> </attributeDescriptors> </RegistrationDescriptor>

when i directly run this commands separately raw data is coming so i want to store that raw data in a text file for which i have this above commands and saved as .sh extension and then tried to run as :
"sh myscript.sh >> mydata.txt"

but then to my data is not getting stored error is coming as:

"Connection closed by foreign host"

Last edited by jim mcnamara; 04-27-2012 at 08:54 AM..
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

scripting Telnet

can someone tell me how i can write a shell script that will automatically log me in to any machines i want without bothering me for some password input? (i know i have to put in a password but I would like to take care of that in the script) can anyone help me here? (2 Replies)
Discussion started by: TRUEST
2 Replies

2. UNIX for Dummies Questions & Answers

Telnet FTP scripting

Hi quick question from a unix newbie Working on a project to get me using unix, the point of this project is to find a printer on the network check for jobs in the printer if the printer has no jobs do nothing if the printer has jobs then check the status for errors and e-mail the user. This... (2 Replies)
Discussion started by: w33man
2 Replies

3. Shell Programming and Scripting

difference between AIX shell scripting and Unix shell scripting.

please give the difference between AIX shell scripting and Unix shell scripting. (2 Replies)
Discussion started by: haroonec
2 Replies

4. Shell Programming and Scripting

Shell scripting with Telnet

Hi, im brasilian, sorry for bad english ok? Well, im writing one honeypot, look: #!/bin/bash echo "" echo `cat /etc/welcome.pot` echo "" echo -n "login: "; read usuario echo -n "Password: " #stty -echo read -s senha #stty echo exit Running it in localhost, thats right: ... (1 Reply)
Discussion started by: juniordevil
1 Replies

5. Shell Programming and Scripting

Need Help on Telnet using PERL Scripting

Iam trying to connect to a system through Telnet using net::Telnet Module #!/usr/bin/perl -w use net::Telnet $myPassword = "abcdef"; $telnet = new Net::Telnet ( Timeout=>10, Errmode=>'die'); $telnet->open (10.10.20.00); $telnet->waitfor ('/USERCODE: $/i'); $telnet->print('abc');... (2 Replies)
Discussion started by: sudhakaryadav
2 Replies

6. Shell Programming and Scripting

BASH (or else) scripting for Telnet

Hi everybody, I am thinking on writing a shell script to telnet to Cisco routers, and I am looking for help. I have researched some and could not find much on the topic, or at least much of help anyway... I read "expect" is one solution, but I am looking for something more flexible, as I... (1 Reply)
Discussion started by: ppucci
1 Replies

7. Shell Programming and Scripting

Call Shell scripting from Perl Scripting.

Hi How to call a shell scripting through a Perl scripting? Actually I need some value from Shell scripting and passes in the Perl scripting. So how can i do this? (2 Replies)
Discussion started by: anupdas
2 Replies

8. What is on Your Mind?

Shell scripting vs Perl scripting

Hi all, I would like to start developping some good scripting skills. Do you think it would be best to start with shell scripting or Perl? I already got a fundation, really basics, in perl. but I am wondering what would be best to be good at first. Can you please help me determine which one to... (14 Replies)
Discussion started by: Pouchie1
14 Replies

9. Web Development

Perl scripting or shell scripting?

i am going to study any one of the scripting languages mentioned above(shell 0r perl scripting) . Which is having more scope for a fresher? (1 Reply)
Discussion started by: Anna Hussie
1 Replies

10. Shell Programming and Scripting

Expect scripting telnet stop on bad username or password

I am trying to build and expect script to log into multiple aix boxes and change password. I need for the script to terminate if it cannot log into a server because the username or password is wrong. #!/usr/bin/expect set timeout 1 set host set user set password set uh "Unknown host" set... (3 Replies)
Discussion started by: leemalloy
3 Replies
RSRCE(1)							 Debian GNU/Linux							  RSRCE(1)

NAME
rsrce - editor for raw MacOS resource forks SYNOPSIS
rsrce [-e] [-f script] [-o output-file] [input-file] DESCRIPTION
Rsrce is a command driven Macintosh resource fork editor for Unix-like operating systems. It works with raw resource forks stored in Unix files, such as the .rsrc files produced by the macutil package. Rsrce doesn't allow you to edit the resource data directly. It only knows to import/export them from/to files, performing conversion for the few resource types it knows. OPTIONS
-e When this option is given, the failure of an editor command will cause rsrce to quit immediately with a non-zero exit status. This is similar to the -e option to /bin/sh. -f script Instructs rsrce to read its commands from the given script, instead of using the standard input. -o output-file Specifies a default output file for the writecommand. Useful when calling rsrce scripts which save their changes with a write com- mand without a filename. If an input-file is specified, it is loaded before rsrce starts reading commands, and is used as the default output file if the -o option has not been given. USAGE
Rsrce reads commands from the standard input. Unquoted whitespace is ignored, except for the purpose of separating arguments. Empty lines are ignored, and a # at a position where an argument would have started indicates a comment which extends to the end of the line. Text within single quotes is used as-is. An unquoted backslash can be used the way it works in C strings, or to force literal interpretation of the following character. Resources are referred to by specifing their type and id, separated by a colon. I mean, something like "STR#:128". If the given type has less than 4 letters, spaces are added to complete it. The following commands are available: read [file] read the resources from file write [file] write the resources to file create resource create a new, empty resource with the given type and id delete resource remove the specified resource rename resource new-name change the name associated with resource to new-name chattr resource attr-spec change the attributes of resource according to attr-spec ls list each resource's type, id, attributes, data lenght, and name hexdump resource show an hexdump of resource's data import|export resource file [ext] import/export resource's data from/to file. The conversion which is performed depends on the extension of the given filename. This extenstion may be overriden by providing the extargument. edit resource[ext] invoke an external editor to change resource's data help list available commands exit terminate rsrce (without saving, use write before exit if you wish to save your changes) CONVERSION OF RESOURCE DATA
When rsrce imports or exports resource data, a conversion can be performed depending on the resource type and the extension of the provided filename. The following extensions are known to rsrce: bin causes no conversion, the raw resource data is used regardless of the resource type; txt causes the resource data to be converted to plain text. This is possible for STR, STR#andCMDLresources. BUGS
Rsrce has only been originally created to change the configuration of the miBoot Linux bootloader for OldWorld PowerMac computers. Since I do not use MacOS, I haven't tested any other usage of this program. You should therefore be very careful when using it, as it could very well produce unusable output. Another consequence of this is wildly missing functionnality. I'm not going to work on it, since I couldn't test anything in a real situa- tion. Patches and/or usage reports would be very welcome. AUTHOR
Jeremie Koenig <sprite@sprite.fr.eu.org> SEE ALSO
hfsutils(1), macutil(1) Debian Project 2004-03-26 RSRCE(1)
All times are GMT -4. The time now is 06:26 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy