Questions tagged [tcl]
57 questions
7
votes
2 answers
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 directory , then need to create this directory and add…
maihabunash
- 6,973
- 19
- 64
- 80
4
votes
1 answer
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 the tcl-dev tk-dev bwidget tk-table packages. Here is…
iago-lito
- 2,581
- 4
- 20
- 35
3
votes
2 answers
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 directories:
/usr/local/lib/tcl8.0…
user45898
- 41
- 1
- 2
3
votes
2 answers
rlwrap: tclsh multi-word autocompletion
How do I get multi-word autocompletion with rlwrap for tclsh?
Example: I type file then pressing I only want to see the sub-commands to file, such as exists isdirectory or isfile.
I tried adding file\ isfile (i.e. escaping the…
Axel Bregnsbo
- 263
- 3
- 11
2
votes
2 answers
how to send special characters in expect script?
I'm trying to send special characters (password) which contains #?!k;|C .
The password is dynamic and cannot be hardcoded in the script, so I'm passing it as variable as shown below
$ expect ./passwordlessSSH.exp $hostname "$password"
the code of…
user2925298
- 21
- 1
- 2
2
votes
2 answers
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 calculations, whose value is something like {3.5400…
mandrake00
- 79
- 1
- 8
2
votes
2 answers
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]
close $f
# Iterate over the hosts
foreach host $hosts…
muku
- 41
- 1
- 4
- 8
2
votes
1 answer
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 following…
Sometowngeek
- 121
- 3
2
votes
2 answers
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 button press. Adding an exec or a dot before the action…
saga
- 1,381
- 11
- 36
2
votes
0 answers
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 outcome $expect_out(buffer)
set records [split…
ZhKSteaL
- 21
- 1
2
votes
0 answers
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 instructions for Expect state:
By default, the Tcl source…
user144150
2
votes
3 answers
'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 connect to display ":0.0".
The Cygwin/X server has been…
Rainer Lampatzer
- 21
- 1
- 1
- 3
2
votes
3 answers
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 Do the following:
set starttime [string range…
Shiunbird
- 63
- 1
- 7
1
vote
1 answer
Expect exiting, not responding to text sent
I have an expect script that is exiting, instead of processing text that is sent and installing files. I'm trying to figure out why it's not installing files, i.e. not implementing what would be done had I run the process manually instead of via…
Burvil
- 13
- 1
- 3
1
vote
2 answers
How to print lines from file a file in a way of sequence i.e. sorted on basis of a specific column inside tcl script?
I want to print the file content based on sorting the 3rd column of sourcefile.
sourcefile.txt:
Manav Kumaom Fre
shailesh himadri aif
manisha Kailash mac
Ravi Jwala blu
Prakash Ojha Zan
Mahi Aulakh yep
I want to print the file content sorted on the…
Manisha Kuhar
- 57
- 2
- 6