Skip to main content

Questions tagged [tcl]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0 votes
1 answer
32 views

expect - repeatably send "\n\r" before a match expect

I need to netcat a U-Boot and perform NAND script and I use below script spawn netcat -lup 6666 expect "Hit any key to stop autoboot" #autoboot counts down from 3 to 0 and somehow one or ...
thomasyang's user avatar
0 votes
2 answers
35 views

Iterating arrays in TCL where array names have a numeric suffix

In TCL, I have a few arrays whose names have a numeric suffix (i.e., whose names end with a number), like below: array set ps0 [ list 0 15.885 1 55.43 1 0.254 2 0.227 3 0.177 ] array set ps1 [ list 0 ...
poppycock's user avatar
1 vote
4 answers
286 views

How to remove entire string that match specific pattern in unix txt file with a single command line

I would like to remove all the strings that contain "vcc". Example: s_regscan_ctrl_lab_2_regscan_ce[0] s_regscan_data_l_regscan s_t_regscan_data_tieoff_regscan vcc_cram_viort1_6_t ...
bg yeoh Yeoh's user avatar
0 votes
1 answer
283 views

TCL - Error in startup script: expected integer but got "Sans"

I am trying to run a tcl script using wish as $ wish main.tcl output of the command is Error in startup script: expected integer but got "Sans" (database entry for "-font" in ...
Akhil's user avatar
  • 1,310
-1 votes
1 answer
623 views

How to grep the difference between two files into a file

Saying that I have two files: a.txt and b.txt. The content of a.txt: mosfet23 cap098 inductors 98 metal96 The content of b.txt: test 23 cap098 drc45 metal96 lvs cap098 Of course I can use vimdiff to ...
ironman junior's user avatar
0 votes
1 answer
1k views

Installation of core emulator : 'tcl8.5' not installing

I'm trying to install core emulator on Ubuntu 20.04 and I came across an installation procedure and it had the following command $ sudo apt-get install bash bridge-utils ebtables \ iproute libev-dev ...
Orpheus's user avatar
  • 101
0 votes
2 answers
1k views

Tcl command to find latest created folder in a directory

i have a folder where there are subfolder with dates example : Parent/2020-11-09_15.47.36 Parent/2020-11-10_16.52.02 and so on. now I want to find out which is the latest date folder inside Parent ...
Panda's user avatar
  • 1
1 vote
1 answer
707 views

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 ...
Burvil's user avatar
  • 13
-1 votes
1 answer
61 views

Perform calculations on tabulated results and print the results in tabulated form

I have a report which displays the clock periods along with the clock names and duty cycle. Now, I would like to use tcl or awk or perl to make it display with clock period interms of freq and the ...
aravi's user avatar
  • 1
1 vote
2 answers
988 views

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 ...
Manisha Kuhar's user avatar
0 votes
1 answer
4k views

how to convert a list to array in tcl?

It may be a trivial question; but I am facing problem to covert a list to array inside a tcl script. set mylist { one two three four five } I need to convert this to array myArr. One more doubt, Can ...
Manisha Kuhar's user avatar
1 vote
2 answers
4k views

How to use 'awk' in tcl script?

It might be trivial, but I am facing problem in using awk for simple purpose like printing first row in a file using tcl script. I used the following command inside tcl script: awk '/manager/ {print $...
Manisha Kuhar's user avatar
0 votes
1 answer
1k views

Exit out from loop on incorrect password in expect TCL shell script

I have written a code snippet in TCL expect to connect from Server 1 to Server 2 using ssh. Users already may have set passwordless communication between Server 1 and Server 2, or it may ask for a ...
newuser's user avatar
0 votes
1 answer
314 views

Extract data from multiple nested parenthesis in TCL

I need another help, this is in continuation of Extract data from the nested parenthesis in bash, I have input data like below with multiple blocks, I want to put a logic to check for network vlans ...
IceAndFire's user avatar
0 votes
1 answer
79 views

Expect - parse all occurrences of a pattern and store in a variable

I am trying to process multiple mac addresses from output of a program. Output is in below format - Device B0:CA:68:CF:88:54 dev1 Device DC:16:B2:AE:FB:8F dev2 Device B0:CA:68:CF:88:11 dev3 Device DC:...
fatalkill3r's user avatar
1 vote
1 answer
303 views

Upgrading from Python2.7.12 to Python 3.8.1 on macOS 10.15.2 Catalina in Wing IDE Shell

There are many threads online about making this upgrade. However, most people say not to remove the old Python2 - this can mess up the macOS on your system. I've thus installed Python3.8.1 (I needed ...
Ed Polo's user avatar
  • 21
0 votes
1 answer
1k views

Problem in using AWK in TCL expect

i am getting problem in using AWK command in TCK/TK unix command: var=`awk -v var1="^$line" -F "|" '$1~var1{print $1 }' sort-address-name-ip.txt | awk -v var2="$line$" '$0~var2'` and i used as: ...
gcngov's user avatar
  • 809
3 votes
3 answers
9k views

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 ./...
user2925298's user avatar
0 votes
0 answers
234 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 ...
gboffi's user avatar
  • 1,454
1 vote
1 answer
1k 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 ...
John's user avatar
  • 113
1 vote
3 answers
974 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 ...
jwk's user avatar
  • 11
2 votes
2 answers
3k 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 ...
mandrake00's user avatar
0 votes
2 answers
997 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 ...
ZHA's user avatar
  • 11
-1 votes
3 answers
1k 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 ...
KuboMD's user avatar
  • 429
2 votes
2 answers
10k 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] ...
muku's user avatar
  • 41
0 votes
2 answers
4k 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 ...
muku's user avatar
  • 41
0 votes
1 answer
847 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 ...
ralz's user avatar
  • 2,006
2 votes
1 answer
548 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 ...
Sometowngeek's user avatar
0 votes
1 answer
2k 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 ...
aavam's user avatar
  • 1
1 vote
1 answer
10k 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 ...
Bhavya Jain's user avatar
1 vote
3 answers
12k 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 "...
Fisher's user avatar
  • 163
0 votes
2 answers
700 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 ...
Zumo de Vidrio's user avatar
1 vote
2 answers
4k 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 "...
Bebe's user avatar
  • 37
0 votes
2 answers
1k 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 ...
chromechris's user avatar
2 votes
2 answers
825 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 ...
saga's user avatar
  • 1,401
0 votes
1 answer
233 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....
Coty Condry's user avatar
1 vote
0 answers
3k 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 ...
user977828's user avatar
1 vote
1 answer
351 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 ...
JigarGandhi's user avatar
  • 4,990
3 votes
2 answers
1k 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 ...
Axel Bregnsbo's user avatar
2 votes
0 answers
342 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 ...
ZhKSteaL's user avatar
0 votes
1 answer
165 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-...
Alexander's user avatar
2 votes
0 answers
2k 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 ...
user avatar
1 vote
2 answers
2k 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/...
Aivar's user avatar
  • 235
0 votes
1 answer
1k 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 ...
m00tpoint's user avatar
2 votes
3 answers
19k 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 ...
Rainer Lampatzer's user avatar
-1 votes
2 answers
3k 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 ...
NFTX's user avatar
  • 5
4 votes
1 answer
2k 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 ...
iago-lito's user avatar
  • 2,811
1 vote
2 answers
2k 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) ...
user120451's user avatar
1 vote
0 answers
116 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....
user45857's user avatar
  • 145
1 vote
0 answers
1k 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 [...
Novice User's user avatar
  • 1,389