tcl

How to use angle brackets in the command line arguments?

蹲街弑〆低调 提交于 2020-01-21 10:24:20
问题 How to use an angle brackets in command line arguments? Suppose the input is: filename -w <input.txt> Here input.txt is a second command line argument, and it is an input file to a program here input.txt must be enclosed by angle brackets( <input.txt> ) . But if I use angular brackets i m getting error. error is : sh: -c: line 0: syntax error near unexpected token `newline' sh: -c: line 0: `demo -w ' 回答1: Your question is not very clear. However, it seems to me a shell problem, not a Tcl one.

How to run tcl script in other tcl script?

白昼怎懂夜的黑 提交于 2020-01-21 04:12:04
问题 I have two tcl scripts. And I want to run second script when first finished. How can I do it? 回答1: Depends on what do you really mean. One way is to write a third ("master") script which would do source /the/path/to/the/first.tcl source /the/path/to/the/second.tcl Another way is to just add the second call to source from the above example to the bottom of the first script. Amendment to the first approach: if the scripts to be executed are located in the same directory as the master script, an

Running Matlab Command From Tcl

我的未来我决定 提交于 2020-01-17 14:59:51
问题 From my TCL script I like to open Matlab command window and display if its Matlab win32 or win64. Therefore I use the following command: exec {*}matlab -nodisplay -nosplash -nodesktop -r "arch = computer; fprintf('%s \n', arch')"; However I keep getting error: arch = computer; fprintf('%s | Error: String is not terminated properly. If I run the same in Matlab no issues. Could some kindly advice. Thanks Anj. 回答1: Tcl is substituting the \n before handing the command to matlab. Escape it: exec

Can't find package BLT

吃可爱长大的小学妹 提交于 2020-01-17 13:26:44
问题 I am having a problem of getting BLT to work with Tcl/TK. I installed BLT library for TCL/TK but when i try running a tcl program to plot a graph, it keeps giving me an error saying "can't find package BLT". In my program I have already included: package require BLT I also appended the BLT part to my environmental variable on my windows operating system 32 bit but it still doesn't work. Please what do i need to do? 回答1: To make that work, the directory containing the BLT package needs to be

Can't find package BLT

你。 提交于 2020-01-17 13:22:13
问题 I am having a problem of getting BLT to work with Tcl/TK. I installed BLT library for TCL/TK but when i try running a tcl program to plot a graph, it keeps giving me an error saying "can't find package BLT". In my program I have already included: package require BLT I also appended the BLT part to my environmental variable on my windows operating system 32 bit but it still doesn't work. Please what do i need to do? 回答1: To make that work, the directory containing the BLT package needs to be

tcl extra characters after close-brace

二次信任 提交于 2020-01-17 08:21:22
问题 i have this error Tcl error : extra characters after close-brace proc exact {nick host handle channel text} { global db_handle network; set size exec curl -3 --ftp-ssl -k ftp://xxx:xxx@192.210.0.8:2300/source/ | grep \\.r | awk '{print $5}'| awk '{ SUM += $1} END { print SUM/1024/1024 }' putnow "PRIVMSG #chnnel :source has $size" } 回答1: Per the exec(n) man page you need to replace single quotes with curly braces. You also need [] around exec to invoke it: set size [exec curl -s -3 --ftp-ssl

Editing file in TCL and writing the revised contents to an output file

十年热恋 提交于 2020-01-17 03:43:07
问题 I have an input file fI as follows :- module c1 accent {a1} {Z} ;# net:n1551 , little:big accent {a2} {C} ;# net:n1536 , little:big module c2 accent {a3} {Z} ;# net:n1552 , little:big accent {a4} {C} ;# net:n1537 , little:big I want to manipulate this input file and get the output file fO as follows:- accord [get_pins c1/a1/Z] [get_nets c1/n1551] accord [get_pins c1/a2/C] [get_nets c1/n1536] accord [get_pins c2/a3/Z] [get_nets c2/n1552] accord [get_pins c2/a4/C] [get_nets c2/n1537] How can i

TK/TCL, trouble understanding this tic tac toe code snippet

旧巷老猫 提交于 2020-01-17 02:51:04
问题 Can anyone help explain to me what the snippet below does. This code snippet is taken from http://wiki.tcl.tk/12374. It is meant to create a tic tac toe game. There are not many resources out there for understanding Tk/Tcl so this is giving me significant difficulty. proc DrawBoard {{redraw 0}} { global S B GAME C if {$redraw} { ;# Must redraw everything .c delete all set w2 [expr {$B(w2) - 15}] ;# Make a little margins set h2 [expr {$B(h2) - 15}] set hbar [expr {$h2 / 3.0}] set vbar [expr {

Split a list of numbers into smaller list based on a range in TCL

痞子三分冷 提交于 2020-01-16 11:58:08
问题 I have a sorted list of numbers and I am trying to split the list into smaller lists based on range of 50 and find the average in TCL. For eg: set xlist {1 2 3 4 5 ...50 51 52 ... 100 ... 101 102} split lists: {1 ... 50} { 51 .. 100} {101 102} result: sum(1:50)/50; sum(51:100)/50; sum(101:102)/2 回答1: The lrange command is the core of what you need here. Combined with a for loop, that'll give you the splitting that you're after. proc splitByCount {list count} { set result {} for {set i 0} {$i

Slow response to database write from php

好久不见. 提交于 2020-01-15 12:16:05
问题 I have my PHP scripts running on the WAMP server. Here's what i am doing PHP script A that queries the database and gets a set of rows (I have set the set_time_limit (0) // unlimited time for the script to execute ) Based on the result set I execute a tcl script for each row of the result set The TCL script takes about a minute to execute , it also inserts some data to the same database Now simultaneously when the TCL script is executing , if i execute another PHP script that writes in to the