I haven't tried what you're trying to do before, but the syntax you're using mostly looks OK.
You haven't said what operating system you're using and that can make a difference for some versions of ssh. On most systems, the destination device has to follow the options, so there is a chance that it might work if you change:
to:
Obviously, this is totally untested. I would suggest that you turn on tcl's debugging output by including the -d option when you start it.
This User Gave Thanks to Don Cragun For This Post:
hai all,
i have an tcl script in which i have been reading the DUT Command prompt of an cisco switch as
DUT Command Prompt : cisco*
and running the test case of stp now the problem is if i have given any blank space in between the cisco or at the startup then the Expect is not identifying the... (0 Replies)
Does anyone know of an expect/tcl forum that is as helpful as this one is for shell scripting?
Or if anyone has any expect knowledge, can you please provide some guidance on how to write to a local error log based on output from a ssh session?
I have something like this:
foreach host... (2 Replies)
In the following "for" loop I assume the the script will expect "anyway", "first" NOT in any paticular order and send "yes" when there found, breaking out of the loop when "$prompt" is found. The way it is working is like 3 individual expect lines, and they MUST be in cronological order. ANY help... (0 Replies)
Can someone identify what is the problem here?.
no children
while executing
"exp_wait -nowait -i -1"
(procedure "logOptions" line 45)
invoked from within
"logOptions"
(procedure "doExecute" line 98)
invoked from within
"doExecute"
(procedure "main" line 32)
... (7 Replies)
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)
So here is what I am trying to do. I have a large # of switches and routers I am trying to log into. Unfortunately some have ssh only, some have telnet only. and some i have never logged into with ssh. I first want it to SSH, if i have never logged into the box it will ask for adding the ssh key. I... (0 Replies)
hi, I am new in Expect.
I have a question about expect timeout.
suppose I have a structure of
expect { ".."{
send"............"}
timeout{
...............
}
}
The silly question is if I reach timeout, how can I store the error message showing on the screen to... (2 Replies)
Hi gurus, I am trying to do some expect/TCL magic. My goal is to write some kind of password guessing script (nearly similar to dictionary attack against ssh). I read that this could be possible with expect/TCL, I am newbie in this language, its function and its terms so please be patient ;)
... (3 Replies)
The below error message I started seeing using Ubuntu 14.04 and was wondering if the forum has seen it because I cant seem much on the net for this:
perl -e 'use IO::Socket::SSL qw(debug3);IO::Socket::SSL->new(PeerAddr=>"10.0.0.100",PeerPort=> 443,Proto=>"TCP") or die $!'
DEBUG:... (1 Reply)
Discussion started by: metallica1973
1 Replies
10. Forum Support Area for Unregistered Users & Account Problems
Neo
Thanks for your reply to my original post, entitled "Problem changing the email address associated with my unix.com account".
I am unable to reply to you in that thread, as I am unable to log-on to unix.com!
From what you said about purging dormant accounts, it is likely that my account... (1 Reply)
Discussion started by: irb
1 Replies
LEARN ABOUT FREEBSD
filemon
FILEMON(4) BSD Kernel Interfaces Manual FILEMON(4)NAME
filemon -- the filemon device
SYNOPSIS
#include <dev/filemon/filemon.h>
DESCRIPTION
The filemon device allows a process to collect file operations data of its children. The device /dev/filemon responds to two ioctl(2) calls.
System calls are denoted using the following single letters:
'C' chdir(2)
'D' unlink(2)
'E' exec(2)
'F' fork(2), vfork(2)
'L' link(2), linkat(2), symlink(2), symlinkat(2)
'M' rename(2)
'R' open(2) for read
'S' stat(2)
'W' open(2) for write
'X' _exit(2)
Note that 'R' following 'W' records can represent a single open(2) for R/W, or two separate open(2) calls, one for 'R' and one for 'W'. Note
that only successful system calls are captured.
IOCTLS
User mode programs communicate with the filemon driver through a number of ioctls which are described below. Each takes a single argument.
FILEMON_SET_FD Write the internal tracing buffer to the supplied open file descriptor.
FILEMON_SET_PID Child process ID to trace.
RETURN VALUES
The ioctl() function returns the value 0 if successful; otherwise the value -1 is returned and the global variable errno is set to indicate
the error.
FILES
/dev/filemon
EXAMPLES
#include <sys/types.h>
#include <sys/stat.h>
#include <sys/wait.h>
#include <sys/ioctl.h>
#include <dev/filemon/filemon.h>
#include <fcntl.h>
#include <err.h>
#include <unistd.h>
static void
open_filemon(void)
{
pid_t child;
int fm_fd, fm_log;
if ((fm_fd = open("/dev/filemon", O_RDWR | O_CLOEXEC)) == -1)
err(1, "open("/dev/filemon", O_RDWR)");
if ((fm_log = open("filemon.out",
O_CREAT | O_WRONLY | O_TRUNC | O_CLOEXEC, DEFFILEMODE)) == -1)
err(1, "open(filemon.out)");
if (ioctl(fm_fd, FILEMON_SET_FD, &fm_log) == -1)
err(1, "Cannot set filemon log file descriptor");
if ((child = fork()) == 0) {
child = getpid();
if (ioctl(fm_fd, FILEMON_SET_PID, &child) == -1)
err(1, "Cannot set filemon PID");
/* Do something here. */
} else {
wait(&child);
close(fm_fd);
}
}
Creates a file named filemon.out and configures the filemon device to write the filemon buffer contents to it.
SEE ALSO dtrace(1), ktrace(1), script(1), truss(1), ioctl(2)HISTORY
A filemon device appeared in FreeBSD 9.1.
BSD June 14, 2013 BSD