I got that figured out, right now I am trying to do a foreach loop, I want this script to read a file that have some hosts in it and save the config for each one:
Hello to all...this is my first post (so please go easy). :)
I feel pretty solid at expect scripting, but I'm running into an issue that I'm not able to wrap my head around. I wrote a script that is a little advanced for logging into a remote Linux machine and changing text in a file using sed.... (2 Replies)
hi, everyone:
I just wonder how to save the output of command, I mean everything, save as a string into a variable.
another question is I try to ls the details of a directory, but it works in the shell, not in the script.
for example
code: ls -ltr *se100* | grep ^- | tail -1 | awk '... (1 Reply)
This Expect script provides expect with a list of IP addresses to Cisco IPS sensors and commands to configure Cisco IPS sensors. The user, password, IP addresses, prompt regex, etc. have been anonymized. In general this script will log into the sensors and send commands successfully but there are... (1 Reply)
I have an Expect script which works very well. It logs into my remote routers and runs some commands and then to the next until finished. I need two things, first I need to save the output to a file from where the log_user 1 begins.
expect << EOF
set timeout 15
#set var "exit "
match_max... (1 Reply)
Hi,
I'm trying to save a crontab configuration using SSH, acessing a Linux machine from a Windows desktop.
So, in the prompt I type "crontab -e", to edit crontab, and a window is opened.
But after writing the changes, I press Save button but it seems not working, because when... (1 Reply)
Hey all. Sometimes I'm tasked to change some router configs for the entire network (over 3,000 Cisco routers). Most of the time its a global config parameter so its done with a loop and an IP list as its the same configuration change for all routers. This is working OK.
However, sometimes an... (3 Replies)
Hey everyone,
I have a few question.
1. Is it possible to display cisco 'show run' output command to the application ??
2. And is there any ways to log in to the router instead of using telnet from telnet application???
Thanks in advance (0 Replies)
Hello C specialists,
I'm trying to write a program to read out a binary configuration file produced by a router.
But the output of Name and Value is cryptic. What's going wrong?
The structure of the binary file is very simple:
struct nvram_tuple {
char *name;
char *value;
... (5 Replies)
Hi,
For some reason I was needed to ping some URL and save the output to a file through Expect script, following is a very basic of that script, but it fails everytime. When I just copied the same 'ping' line to normal Terminal and run, it runs fine. Please, help.
#!/bin/sh
spawn ping -c 3... (1 Reply)
I'm fairly new to scripting so this might not be possible.
I am using Expect with Cisco switches and need to capture the string after finding the expect request. For example, when I issue "show version" on a Nexus switch, I'm looking to capture the current firmware version:
#show version
... (0 Replies)
Discussion started by: IBGaryA
0 Replies
LEARN ABOUT SUNOS
telnetrc
telnetrc(4) File Formats telnetrc(4)NAME
telnetrc - file for telnet default options
DESCRIPTION
The .telnetrc file contains commands that are executed when a connection is established on a per-host basis. Each line in the file con-
tains a host name, one or more spaces or tabs, and a telnet(1) command. The host name, DEFAULT, matches all hosts. Lines beginning with the
pound sign (#) are interpreted as comments and therefore ignored. telnet(1) commands are case-insensitive to the contents of the .telnetrc
file.
The .telnetrc file is retrieved from each user's HOME directory.
EXAMPLES
Example 1: A sample file.
In the following example, a .telnetrc file executes the telnet(1) command, toggle:
weirdhost toggle crmod
# Always export $PRINTER
DEFAULT environ export PRINTER
The lines in this file indicate that the toggle argument crmod, whose default value is "off" (or FALSE), should be enabled when connecting
to the system weirdhost. In addition, the value of the environment variable PRINTER should be exported to all systems. In this case, the
DEFAULT keyword is used in place of the host name.
FILES
$HOME/.telnetrc
SEE ALSO telnet(1), in.telnetd(1M), environ(5)SunOS 5.10 9 Jan 1998 telnetrc(4)