Sponsored Content
Top Forums UNIX for Beginners Questions & Answers How to pass ^] character for a script to automate sending commands in my telnet device ? Post 303046043 by RudiC on Wednesday 22nd of April 2020 10:20:05 AM
Old 04-22-2020
In bash, try
Code:
printf "\x1D"

or
Code:
echo $'\035'

 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

automate Telnet ?

Hi, I have to run a script shell on a unix server from my windows PC. For that, I open a cmd windows and use Telnet to connect to the unix and run the script (by the .profile of a special user). Is it possible to automate Telnet in order to not enter the user and the password ? Anyway, has... (4 Replies)
Discussion started by: tbeghain
4 Replies

2. UNIX for Advanced & Expert Users

Automate Script using pkgrm/pkgadd commands

This is my first post so hello to all of you! I have a script in bash-3.00 that needs to execute the following: pkgrm (to remove an existing package) pkgadd -d ( to install a new package) The problem is that both commands prompt me to answer either y,n or q in order to proceed with... (13 Replies)
Discussion started by: Insight
13 Replies

3. Shell Programming and Scripting

Expect script to automate telnet session

Hi all, I am currently running a daemon which creates a virtual terminal for testing purposes. Essentially, if I were to interact with it manually, this is what I get. john@test1:~$telnet localhost 7777 Trying ::1... Connected to localhost. Escape character is '^]' mip6d> pl eth2... (6 Replies)
Discussion started by: abxccd
6 Replies

4. Shell Programming and Scripting

Need Help with commands to automate.

HI, In some test cases, I used tools like "dd" and "shed" to manually read a block from the disk, modify it using a hex editor and write it back using "dd". I need help with some linux commands I can use to read the block and change the data to induce the corruption....as I want to automate my... (3 Replies)
Discussion started by: prinsh
3 Replies

5. Shell Programming and Scripting

Script which telnets to a device, runs commands and prints output to a file

I am connecting to a device using telnet, I want my script to perform certain commands : ie- show device , show inventory..etc and write the output it sees from the terminal to a file. this is what I have got : #!/usr/bin/expect -- set running 1 spawn telnet <ip address> expect ... (1 Reply)
Discussion started by: samantha123
1 Replies

6. Shell Programming and Scripting

How to pass enter key or selected character in bash script?

hi, i've bash script thats working... but now i need to add a line....that prompts for user input....like yes and 1 as complete install.... so here's how it looks... $ cd 9200 (cd into directory) $./install (hv to type ./install to run install then ask for) ----do you want to... (4 Replies)
Discussion started by: kernel11
4 Replies

7. Shell Programming and Scripting

Unable to automate telnet login

i have to connect windows server from one of the unix box so i am using telnet and below is my following code #!/bin/sh host=hostname log=loginid port=23 pass=password cmd1=mkdir test1234 ( echo open ${host} ${port} sleep 1 echo ${log} sleep 3 echo "\r\n" sleep 3 echo ${pass}... (11 Replies)
Discussion started by: chandan.p
11 Replies

8. Open Source

Help with writing Shell Script to automate process using multiple commands

Hello! Need help to write a Linux script that can be run from windows using command/Cygwin/any other way. I am new to scripting, actually i am trying to automate server health check like free disk space, memory along with few services status, if any services is not running then start services ,... (7 Replies)
Discussion started by: Sayed Ibrahim
7 Replies

9. UNIX for Beginners Questions & Answers

How can i create a script that will ssh a device and type some commands?

Hi Guys, this is the scenario: ubuntu pc and I have 10 wireless devices that I need to check their firmware version. I would like to create a script that it will ask me IP, after I enter it, I hit enter then it will show me the version of the firmware. this is what i do. ssh... (9 Replies)
Discussion started by: gabak
9 Replies

10. UNIX for Beginners Questions & Answers

Script require to do telnet & run few commands

I am new in scripting, I need script(BASH) which do telenet to one of the elements & run few commands , after running it successfully it will check status of files & exit. Help is greatly appreciated 🙏 (2 Replies)
Discussion started by: Vinesh_123
2 Replies
CON(1)							      General Commands Manual							    CON(1)

NAME
con, telnet, cu, rx, xms, xmr - remote login, execution, and XMODEM file transfer SYNOPSIS
con [ -dCrvs ] [ -l [ remuser ] ] [ -c cmd ] [net!]machine telnet [ -dCrn ] [net!]machine cu number rx [ -n ] [net!]machine [ command-word ... ] xms file xmr file DESCRIPTION
Con connects to the computer whose network address is net!machine and logs in if possible. With no options, the account name used on the remote system is the same as that on the local system. Standard input and output go to the local machine. Options are: -l with an argument causes remuser to be used as the account name on the remote system. Without an argument this option disables auto- matic login and a normal login session ensues. -C forces cooked mode, that is, local echo. -c runs cmd as if it had been typed as a command from the escape mode. This is used by cu. -v (verbose mode) causes information about connection attempts to be output to standard error. This can be useful when trying to debug network connectivity. -d causes debugging information to be output to standard error. -r suppresses printing of any carriage return followed by a new line. This is useful since carriage return is a printable character in Plan 9. -s strips received characters to 7 bits to forestall misinterpretation of ASCII with parity as UTF. The control- character is a local escape. It prompts with the local machine name and >>>. Legitimate responses to the prompt are i Send a quit [sic] signal to the remote machine. q Exit. b Send a break. . Return from the escape. !cmd Run the command with the network connection as its standard input and standard output. Standard error will go to the screen. This is useful for transmitting and receiving files over the connections using programs such as xms. Telnet is similar to con, but uses the telnet protocol to communicate with the remote machine. If standard input is a file or a pipe, the -n option causes telnet not to hang up the connection when it receives EOF on its standard input; instead it waits for the remote end to hang up. It shares con's -C, -d, and -r options. Cu is a shell script that uses telco(4) and con to connect to a machine via a modem. If the machine is equipped with a local modem, it is used. Otherwise, the call is placed through Datakit. Rx executes one shell command on the remote machine as if logged in there, but with local standard input and output. A rudimentary shell environment is provided. If the target is a Plan 9 machine, $service there will be rx. Network addresses for both con and rx have the form network!machine. Supported networks are those listed in /net. The commands xms and xmr respectively send and receive a single file using the XMODEM protocol. They use standard input and standard out- put for communication and are intended for use with con. EXAMPLES
rx kremvax cat file1 >file2 Copy remote file1 to local file2. rx kremvax cat file1 '>file2' Copy remote file1 to remote file2. eqn paper | rx kremvax troff -ms | rx deepthought lp Parallel processing: do each stage of a pipeline on a different machine. SOURCE
/sys/src/cmd/con for con, xms, and xmr. /sys/src/cmd/ip for telnet. /rc/bin/cu BUGS
Under rx, a program that should behave specially towards terminals may not: e.g., remote shells will not prompt. Also under rx, the remote standard error and standard output are combined and go inseparably to the local standard output. CON(1)
All times are GMT -4. The time now is 08:43 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy