2009-04-27

Tclreadline

The tclreadline package makes the GNU Readline library available for interactive tcl shells. This includes history expansion and file/command completion. Command completion for all tcl/tk commands is provided and commmand completers for user defined commands can be easily added. tclreadline can also be used for tcl scripts which want to use a shell like input interface. In this case the ::tclreadline::readline read command has to be called explicitly.

SEE ALSO: Pure-Tcl Readline, Pure-Tcl Readline (2)

2009-04-17

ssh -t hostname vim /your/file

ssh -t

Force pseudo-tty allocation. This can be used to execute arbitrary screen-based programs on a remote machine, which can be very useful, e.g., when implementing menu services. Multiple -t options force tty allocation, even if ssh has no local tty.

2009-04-16

Use rlwrap to add readline support to tclsh

rlwrap [1] is a GNU readline wrapper. it adds readline editing and command history to any command line app.To use it with tclsh, start tclsh with:

$ rlwrap tclsh
Useful options are -c (file name completion) and -f (add words from a file to the completion list).To use rlwrap with tclsh with file name completion type:
$ rlwrap -c tclsh
It would be nice to have a file of all words used in Tcl: commands and subcommands to set rlwrap up using the -f option.info commands and info procs could help with that. Maybe there are some *.syn files out there to provide such a database.

2009-04-15

Give up OS X on iBook G4

OS X 系统的不 open 导致的痛苦由来已久,早有心意弃之,一直未下决心。现苹果已转投 Intel,放弃 PowerPC,天晓得我的 iBook 还能支持到什么时候?干脆先苹果一步,主动抛弃 OS X,换成了 Debian 5(code named Lenny)。

2009-04-13

About Bash4

ABS Guide 的作者 Mendel Cooper 在 6.0.05 版中对 Bash4 有如下 Editorial comment:

Associative arrays? Coprocesses? Whatever happened to the lean and mean Bash we have come to know and love? Could it be suffering from (horrors!) "feature creep"? Or perhaps even Korn shell envy?

Note to Chet Ramey: Please add only essential features in future Bash releases -- perhaps for-each loops and support for multi-dimensional arrays. Most Bash users won't need, won't use, and likely won't greatly appreciate complex "features" like built-in debuggers, Perl interfaces, and bolt-on rocket boosters.

俺也感觉 bash4 的开发激进了些, 功能不稳定, feature 太花哨, 不几天的功夫 patch 已经出 17 个了. :(

Compile Expect 5.44.1.11 on Fedora 3

  • Checkout expect from Sourceforge.net
  • Open configure.in, comment out following lines:
    TEA_PATH_TKCONFIG
    TEA_LOAD_TKCONFIG
    TEA_PUBLIC_TK_HEADERS
  • Open Makefile.in:
  1. Remove expectk from var in_BINARIES
  2. Remove @TK_INCLUDES@ from var INCLUDES
  3. Remove @TK_LIB_SPEC@ and @TK_LIBS@
  • $ autoreconf -fiv
  • $ ./configure --prefix=/usr/local/expect-5.44 --exec-prefix=/usr/local/expect-5.44 --with-tcl=/usr/lib --with-tclinclude=/usr/include/tcl-private
  • $ make && make install
  • Open /etc/ld.so.conf, add one line: /usr/local/expect-5.44/lib/expect5.44.1.11
  • $ ldconfig
  • $ /usr/local/expect-5.44/bin/expect -v

Expectk

This is a stand alone interpreter which is the basic equivalent of

 #! /usr/bin/tclsh
package require Expect
package require Tk
Note that this interpreter is not intended to interact with Tk applications - instead, it is intended to allow one to write Tk applications that invoke expect in the background. This allows one to have a GUI interface to gather inputs, etc.

2009-04-11

About expect 5.44

http://expect.nist.gov/ was the original home Web site for Expect. It supplies sources and considerable history, background, and instruction. It does fail to mention, though, recognition [1] of Expect as one of the 100 most important publications of NIST's [2] first century. Note that the warning regarding expect 5.44 on that page is seriously out of date. The CVS 5.44 version linked to below is fine (and needed to build against Tcl 8.5).

The current maintenance of the package can be found at http://expect.sf.net/ , with access to the CVS available via sf.net's cvs repository. Note that the link (on the sf.net primary page) for the CVS repository is out of date; visit http://sf.net/projects/expect/ and use the link there to look at the cvs repository from your web browser.

This package is part of the ActiveTcl Batteries Included distribution on unix and as of 2005, the Windows version is available via ActiveTcl as well [3].

2009-04-07

Valgrind for PowerPC on Debian

$ valgrind ./invalid_free
valgrind: Fatal error at startup: a function redirection
valgrind: which is mandatory for this platform-tool combination
valgrind: cannot be set up. Details of the redirection are:
valgrind:
valgrind: A must-be-redirected function
valgrind: whose name matches the pattern: strlen
valgrind: in an object with soname matching: ld.so.1
valgrind: was not found whilst processing
valgrind: symbols from the object with soname: ld.so.1
valgrind:
valgrind: Possible fix: install glibc's debuginfo package on this machine.
valgrind:
valgrind: Cannot continue -- exiting now. Sorry.
$ aptitude install libc-dbg