Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [tcl]

The tag has no usage guidance.

0
votes
0answers
19 views

Tix package (.deb) installed, Tcl doesn't see it

I'm on Debian Sid, I have installed the tix package (as in sudo apt install tix) and later I've tried to load it, as in $ tclsh % package require Tk 8.6.8 % package require Tix can't find package Tix ...
0
votes
1answer
26 views

tcl cd/pwd command with regard to real/symbolic path

When I work under tcl environment, once I cd to a directory, even if the path I specify is its symbolic link, then no matter whether I run pwd -L or pwd -P, they all return the absolute path. This is ...
1
vote
3answers
58 views

How to convert an alias for bash to an alias for csh? -> Or to tcl

alias s2st="ps -A | grep -E "a|b"" works for bash. Then I tried to convert it for csh: set-alias t2st 'ps -A \| grep -E "a\|b"' But csh does quoting so different, I couldn't coupe with... How ...
1
vote
2answers
92 views

using a variable as array name in TCL script (array)

The question is about TCL Arrays. In my TCL script, variable1 is a variable value obtained from other functions(value is something like PATH_xyz.) variable2 is another variable obtained from other ...
0
votes
2answers
137 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
171 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
305 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
54 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
94 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
805 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
4k 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 ...
1
vote
3answers
4k views

Tcl regexp: How to check if variable contains number?

Below is my tcl script for checking if there is any 0-9 number find in the variable. set a "abc" if {[ regexp {[0-9]*} $a ]} { puts "Found number in $a" } else { puts "...
0
votes
2answers
248 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
487 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
2answers
208 views

Triggering a gui from an acpi event

I've made a tkinter app to handle the power button press, but it doesn't launch when it should. Although if I use echo hello>>~/junk as the acpi action, it adds a hello to junk for every power ...
0
votes
1answer
118 views

CentOS - TCL script works from shell but fails in init.d

I have a TCL script in CentOS 6.5 that I run from shell, as root, with no problems. But if I run it as a service from init.d it fails. Here is the init.d script: #!/bin/bash # # camelot Camelot 11....
1
vote
0answers
757 views

configure failed because of See `config.log' for more details

I am trying to compile Tcl, but I got the following error: ~/apps/tcl8.6.6/unix> ./configure --prefix=$HOME/.local/Tcl checking whether to use symlinks for manpages... no checking whether to ...
1
vote
1answer
98 views

substitute at beginning of line

I want to search a pattern and insert a character at the beginning of a line using regsub in TcL. I have to use TcL only Input file mna1 x a1 vss vbn nch_svt_mac nfin=nfin_n1 l=ln1 mna2 x a2 vss vbn ...
3
votes
2answers
414 views

rlwrap: tclsh multi-word autocompletion

How do I get multi-word autocompletion with rlwrap for tclsh? Example: I type file <space> then pressing <tab> <tab> I only want to see the sub-commands to file, such as exists ...
2
votes
0answers
275 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 ...
0
votes
1answer
118 views

Ruby with Tk in Gentoo

How to emerge Ruby with tk/tcl support in Gentoo Linux. I've tried USE="tk" emerge ruby, but it didn't work. Furthermore there is no tk use flag according "https://packages.gentoo.org/packages/dev-...
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 ...
1
vote
2answers
913 views

How to compile Python with (Active)Tcl 8.6?

I'm trying to compile Python 3.5.0 on CentOS 6 with Tcl 8.6. I did ./configure --with-tcltk-includes=I/opt/ActiveTcl-8.6/include --with-tcltk-libs=L/opt/ActiveTcl-8.6/libs --prefix=/home/aivar/...
0
votes
1answer
456 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 ...
2
votes
2answers
6k views

'Couldn't connect to display “:0.0”' error on Cygwin

I'm trying to run tclsh with tk and I get a display error: no display name and no $DISPLAY environment variable Then I try the following: export DISPLAY=:0.0 And of course it says it couldn't ...
-1
votes
2answers
1k views

How to move forward in a line in bash with echo? [closed]

I am trying to make my bash (or tcl) script updates a line with three columns. After going back to the begin of the line I don't know how to move forward skipping some characters. I want to update ...
0
votes
1answer
1k views

Can't make ./configure find tcltk while building R

I am trying to build R-3.2.1 from source with support for tcltk, but anything I try don't work, since I get then in R: > capabilities("tcltk") tcltk FALSE I am running Debian 8, I have installed ...
1
vote
2answers
542 views

Unix command does not work in Tcl script

I'm new to Tcl and UNIX programming. The following command works on the UNIX command-lines, but doesn't work in a Tcl script. $ sort -b -k8 abc.txt | awk '!a[$1]++' error out for 8 (-k8) and 1($1) ...
1
vote
0answers
91 views

How to install iwidgets without root access and set the enviornment

Recently, I want to run a script (PWgui) which requires Tcl (Itk). The manual suggests that I have to install iwidgets4 beforehand. I am using the university cluster and don't have any root privileges....
1
vote
0answers
844 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 [...
1
vote
1answer
269 views

Improving performance of numerical loops in tcl

I'm trying to improve the performance of a Tcl script. It is a simple random sample with replacement algorithm. I know it's better to do this in a more numerically orientated language, but the ...
-1
votes
1answer
454 views

How to get index value from list in tcl? [closed]

I have following set of keywords set keywords {a b c d}. I want to print index value of c. How to do this in tcl?
2
votes
3answers
597 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
11k 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 ...
0
votes
1answer
125 views

How to configure Apache Rivet on openSUSE with YaST2

I need to configure my Apache web local server to view Tcl Apache Rivet web dynamic applications. The problem I run into is my browser forces me to download the file, so Apache doesn't interpret the ...
1
vote
1answer
793 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/...
0
votes
2answers
11k views

How to execute grep in tcl for getting XYZ-123 type pattern

How can I execute this grep command in TCL? grep '[A-Z][A-Z][A-Z]\-[0-9][0-9][0-9]' file1 > file2
1
vote
1answer
4k 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(...
3
votes
2answers
2k views

tkdiff error on Linux Redhat 5.5

I installed tkdiff as root, and it runs fine under that user, but when I switch to a local user I get the error: Application initialization failed: Can't find a usable init.tcl in the following ...