All Questions

Tagged with
Filter by
Sorted by
Tagged with
0
votes
2answers
187 views

Tcl script with multiple spawn expect and send

I am trying to automate the installation of certificate(s):q! in jboss server. i wrote this rudimentary script: #!/usr/bin/expect set Temp_Dir "/tmp/install" set jboss_sec "/opt/jboss/security" set ...
-1
votes
3answers
219 views

How can I avoid this error “couldn't execute ”des“: no such file or directory”?

I'm trying to do encryption in Expect as outlined in this wiki on Ubuntu 16.04. I've installed tcllib root@alarmux:/home/abdmin# apt-get install tcllib Reading package lists... Done Building ...
0
votes
1answer
1k views

Expect script error- extra characters after close-quote

Error while executing send if command, Not sure if I'm missing some tcl syntax. #!/usr/bin/expect -f # Get the list of hosts, one per line ##### set f [open "/tmp/host.txt"] set hosts [read $f] ...
0
votes
2answers
480 views

Monitoring of disk space on multiple Linux server using expect script

I'm trying to write a script using Expect for monitoring multiple servers; the connections will be through ssh using a password. My basic loop is self failing, I'm not sure whether Expect TCL ...
0
votes
1answer
71 views

How to output multi-page output in expect to file without option prompts being logged

I have a script using expect to run some commands on machine over SSH. There is a part of script which issues a commands that causes multi-page output that I want to have saved to file. How can I ...
2
votes
1answer
105 views

Expect wigs out when I use the single quote in [exec ls -h | grep '\.foo' ]

I am trying to store a list of specific files into a variable in expect. In my script, I am trying to compile files that have different file extensions, like .foo, .bar. In this example, I have the ...
0
votes
1answer
867 views

Reading expect script commands from file [closed]

I need to update configurations of several gateways...I have two files: File 1 (ip.txt) : Holds gateways’ IP addresses ---> This files gets updated every month. File 2 (cmd.txt): Holds commands to ...
1
vote
1answer
5k views

How to check whether a given path is a file or directory

I am using the command below in my expect script (in tcl/Tk) for checking whether the entered path is an individual file or directory: set b [exec ./check.sh $file1 | awk -F {=} {{print $1}} ] The ...
0
votes
2answers
280 views

Compose filename inside expect script

I have a file which several lines, let's say: server_file.txt: [main] server1 param1 param2 param3 server2 param1 param2 param3 I want to take the first value of last column to compose a filename ...
1
vote
2answers
1k views

Check for a word in the expect output and add it to a text file [closed]

I have a code like this: #!/opt/tools/unsupported/expect-5.39/bin/expect set timeout 10 match_max 256 log_file report.txt expect_after eof {exit 0} spawn ssh -l user ip expect "(yes/no)?" { send "...
0
votes
1answer
500 views

TCL Expect Not Writing To Output Buffer

I have noticed that my TCL/Expect Script is not writing to the Output Buffer. `#!/usr/bin/expect -f exp_internal 1; #Debug Expect set username [lindex $argv 0]; #Takes Outside Argument set password ...
2
votes
0answers
288 views

Tcl/Expect: Can't set variable value correctly

I'm trying to get IPSec tunnel details from the router. After that fetch lines with IP addresses. So, I have follow code: send "show tunnel ipsec remote 10.10.10.10\r" expect "local" send "\r" set ...
2
votes
0answers
1k views

Installing Expect and TCL

I downloaded the source for expect5.45, and am attempting to install it. tclsh is on the system at /usr/bin/tclsh, but I'm not sure if that means the machine also has "tcl" installed? The ...
0
votes
1answer
490 views

Expect script: How to expect a literal * character instead of * as glob or regex character

I have an expect script that spawns a connection to hunspell to check the spelling of a word. Unfortunately, if the word is in the dictionary, hunspell simply sends back a *. How can I tell expect to ...
1
vote
0answers
865 views

Why the output is not written to log from expect script

I am trying to write the output of the netcat command including the command also to a file by logging into remote servers. But it is not writing. What am I missing ? #!/usr/bin/expect -f set user [...
2
votes
3answers
620 views

Extracting time from logs using tcl, expect

I have logs with the following pattern: 1,30.10.2014,07:51:07,0,0,1,12,28,255,3,255,255,255,0,0,0; 2001,30.10.2014,07:51:07,0,0,0,300,5,0,255; I need to extract date and time... for the first line I ...
6
votes
2answers
12k views

Create a directory if it doesn't exist in TCL

I write expect script that login to remote machine and run there some scripts But I need also to verify the following Verify if directory /var/cti/adm/APP exists. If APP not exists under adm ...
1
vote
1answer
1k views

TCL script try catch

I have a TCL script that sets a number of variables and reads several files. The last file it reads may contain sensitive information, so I need to make sure this file gets deleted even if an error ...
1
vote
1answer
799 views

How can I return a specific error code at this point in my TCL script?

I have a TCL expect script that runs a scp command for uploading a config file to my DNS server: #!/usr/bin/expect -f set config "~/dnsmasq.conf" spawn /usr/bin/scp "$config" root@192.168.1.1:/etc/...
1
vote
1answer
5k views

grep IP addresses in expect script

This is part of code in an expect script, I have a problem with searching IP addresses from a file whose name is in the variable $filename. #!/usr/local/bin/expect -- ###Made by Etihkru#### set env(...