I know something simple is missing here, "log_user 1" is set . . . after this utility opens ${InFile} (handle? for IntInFile) it needs to look for something to appear in the file ${IntInFile} and then send it to the spawned process. Then I am locking the file ${IntInFile} and clearing it out - expecting more activity later from another process which locks it the same way.
The purpose of this utility is to allow strings to appear and re-appear in a file, and drive the spawned process via those strings, which most likely will be options to menu programs etc.
All that works fine, I know that the activities are happening as directed by options/etc read from ${IntInFile}, except I never see any output from those activities. I do see standard out from the initial spawn (perhaps when ${MenuPrompt} gets matched?). Once I get past this I'll add some detection for when the spawned process ends to get out of the loop, that should be about it.
I've tried several things to get some output during these while loops, like the "expect *" and "puts . . .", nothing yet. Can anyone tell me what I'm missing here?
Hi
I am new to Expect scripting. I have to connect to a remote server and capture the output. Here I need output of " send "list registered\r"" to be stored in a file. but after execution, /tmp/capture.txt is of 0 byte
#!/usr/bin/expect
spawn ssh abc@10.10.10.10 -p 5022
expect... (2 Replies)
Hi,
I am using expect to ssh to a remote host and run a program on the remote machine which has a variable runtime. I need to wait until it finishes so I can grab the output file of this program. I am trying to use the output of grep to know when the process finishes. I am trying to capture... (0 Replies)
set fid
set content
close $fid
## Split into records on newlines
set records
send "records splited\n"
send $records\n
set a "test\n"
send $a
foreach rec $records {
## Split into fields on colons
set fields
#set fields
puts $fields
for {set x 1} {$x < 4} {incr x} {... (1 Reply)
Friends,
Need someone's help in helping me with the below requirement for a script:
> For a list of servers(over 100+), I need to login into each of them(cannot configure password-less ssh) & grab few configuration details <
I know, this is possible through expect programming in a simple... (14 Replies)
Friends,
Need someone's help in helping me with the below requirement for a script:
> For a list of servers(over 100+), I need to login into each of them(cannot configure password-less ssh) & grab few configuration details <
I know, this is possible through expect programming in a simple... (2 Replies)
Hey guys,
I am VERY new to linux scripting and was wondering if you could help me with the following:
essentially the use case is the following...a service crashes and a script must be executed to rerun 3000 entries one at a time....your options are to do each of those manually, 1 at a time... (6 Replies)
Having issues with an expect script. I've been scripting bash, python, etc... for a couple years now, but just started to try and use Expect. Trying to create a script that takes in some arguments, and then for now, just runs a pwd command(for testing, final will be command I pass).
Here is... (0 Replies)
Hello All,
I am trying to automate an installation process using expect and sh script. My problem is that during the installation process the expected value can change according to the situation.
For Example if this is a first time installation then at step 3 I'll get "Do you want to accept... (0 Replies)
I want a shell script to call an expect script but I want the expect script to run in the background so the user is not bothered with what is going on. Is there any way to do this?
---------- Post updated at 08:23 PM ---------- Previous update was at 07:39 PM ----------
got it it was
... (1 Reply)