如何在Linux tclsh中通过光标键获取命令历史记录 [英] How to get Command history by cursor key in Linux tclsh

查看:78
本文介绍了如何在Linux tclsh中通过光标键获取命令历史记录的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

可以使用TCL外壳程序(tclsh)中的光标键(如向上箭头键)来获取命令历史记录.

Can get the command history by using cursor key (like up arrow key) in TCL shell (tclsh).

我正在Linux版本2.6.21的fedora上运行tclsh.

I am running tclsh on fedora with linux version 2.6.21.

推荐答案

您要访问readline库,可以使用

You want access to the readline library, you can do that with rlwrap:

$ rlwrap tclsh

有用的选项是 -c 用于完成文件名,以及 -f 用于将文件中的单词添加到完成列表:

Useful options are -c for file name completion, and -f to add words from a file to the completion list:

$ rlwrap -cf my_complete_file tclsh

由于您几乎总是想使用 rlwrap ,因此添加shell别名很有用:

Since you almost always want to use rlwrap, adding a shell alias is useful:

alias tclsh='rlwrap tclsh'

这篇关于如何在Linux tclsh中通过光标键获取命令历史记录的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆