tcl

Tcl.h: no such file or directory

生来就可爱ヽ(ⅴ<●) 提交于 2020-01-03 08:31:48
问题 I'm trying to port some code over from a Solaris box onto a Linux (specifically Redhat) box. Code compiled without issues and ran without issues on the Solaris box. However, in recompiling on Linux, I'm running into an issue with tcl.h - the compiler is telling me that error: tcl.h: No such file or directory for multiple files that #include "tcl.h" . As far as I can tell, both tcl8.4 & tk8.4 are installed: /usr/lib/tcl8.4 /usr/share/tcl8.4 /usr/lib/tk8.4 /usr/share/tk8.4 However, I can't find

How to find the location of TCL procedure?

放肆的年华 提交于 2020-01-03 08:14:28
问题 How can be find the location of procedure (function) in TCL. Under location I mean the source file in which it is declared. I'm trying to read foreign source-code and can not find the declaration of a single procedure, example: set MSISDNElement [regexp -all -inline {ISDN +[0-9]+} $Command] if { $MSISDNElement != "" } { foreach elm $MSISDNElement { set MSISDNValue [list ISDN [getInternationalFormat [lindex $elm 1]]] } } set EptData [list [lindex $Command 1]] InitEptData 3 foreach Element

How to find the location of TCL procedure?

一笑奈何 提交于 2020-01-03 08:14:05
问题 How can be find the location of procedure (function) in TCL. Under location I mean the source file in which it is declared. I'm trying to read foreign source-code and can not find the declaration of a single procedure, example: set MSISDNElement [regexp -all -inline {ISDN +[0-9]+} $Command] if { $MSISDNElement != "" } { foreach elm $MSISDNElement { set MSISDNValue [list ISDN [getInternationalFormat [lindex $elm 1]]] } } set EptData [list [lindex $Command 1]] InitEptData 3 foreach Element

segfault using SWIG converted code for tcl

徘徊边缘 提交于 2020-01-03 03:13:10
问题 I'm having a segmentation fault with my program. In fact I write a library in C++ and convert it for tcl using SWIG. The segfault occurs here: return Tcl_NewIntObj(static_cast< int >(value)); where value=0 the gdb back trace shows: (gdb) bt #0 0x000054b6 in ?? () #1 0xb6650d5d in SWIG_From_long (value=0) at mntdisplay_wrap.cc:1712 #2 SWIG_From_int (value=0) at mntdisplay_wrap.cc:1722 #3 Testguimnt_Init (interp=0x9714e28) at mntdisplay_wrap.cc:3774 #4 0xb76748fe in Tcl_LoadObjCmd () from /opt

How to read the data from standard output in jatcl by running tcl script in java

爷,独闯天下 提交于 2020-01-03 02:51:14
问题 I have two questions basically. I am using JACL interpreter to run TCL script in JAVA. My questions are: How to get the data from standard output after running tcl file? How to pass arguments for tcl script when executing using jatcl? E.G: sample.tcl: `puts "Hi this is from tcl" ` When ran using java as follows: `Interp i = new Interp(); i.eval("source sample.tcl");` then the output will be written to stdout console of JAVA. I want to read that output to some variable like x[] = i.eval(

Exit status code for Expect script called from Bash

杀马特。学长 韩版系。学妹 提交于 2020-01-02 14:05:06
问题 I made a Bash script which uses an expect script to automate ssh logins.The script connects to multiple servers and runs some commands. The bash script prompts for login credentials once. I want to incorporate a feature wherein the script terminates if the login fails for the first server to avoid the script checking for next servers resulting in the user account getting locked. The account lockout happens for 3 consecutive login failures and the number of server the script tries to connect

Exit status code for Expect script called from Bash

流过昼夜 提交于 2020-01-02 14:04:34
问题 I made a Bash script which uses an expect script to automate ssh logins.The script connects to multiple servers and runs some commands. The bash script prompts for login credentials once. I want to incorporate a feature wherein the script terminates if the login fails for the first server to avoid the script checking for next servers resulting in the user account getting locked. The account lockout happens for 3 consecutive login failures and the number of server the script tries to connect

tcl: capture output from “exec diff” which returned non-zero

若如初见. 提交于 2020-01-02 10:02:56
问题 I know it is common to use catch when executing commands that may return non-zero... but how can I get the output in that case? To be specific, I wish to do something like "catch {exec diff fileA fileB} ret". The files are different and ret value is 1. What I actaully need is the output of diff, the detailed differences. But I believe the "catch {exec ...} err" practice does not provide it, right? Can someone please suggest on this task? Is there tcl-builtin commands to do file diff? (I think

Can I use pcap library for receiving ipv6 packets?

非 Y 不嫁゛ 提交于 2020-01-02 05:38:08
问题 I am trying to convert hping3 to hping6. hping3 uses Pcap library to receive IPv4 packets. But I need to receive IPv6 packets. 回答1: That is possible. libpcap is able to catch anything on the wire. 回答2: Example using ETHERTYPE_IPV6 : static u_int16_t ether_packet(u_char *args, const struct pcap_pkthdr *pkthdr, co nst u_char *p) { struct ether_header *eptr = (struct ether_header*)p; assert(pkthdr->caplen <= pkthdr->len); assert(pkthdr->caplen >= sizeof(struct ether_header)); return eptr->ether

how to read a large file line by line using tcl?

风格不统一 提交于 2020-01-02 05:06:23
问题 I've written one piece of code by using a while loop but it will take too much time to read the file line by line. Can any one help me please? my code : set a [open myfile r] while {[gets $a line]>=0} { "do somethig by using the line variable" } 回答1: The code looks fine. It's pretty quick (if you're using a sufficiently new version of Tcl; historically, there were some minor versions of Tcl that had buffer management problems) and is how you read a line at a time. It's a little faster if you