使用 bash 模拟按键
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/14181488/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-18 04:10:34 来源:igfitidea点击:
Simulating key press using bash
提问by abilash
I try to run gedit from terminal and type some text in a file opened there, but have no success. I try to use gedit; sleep 2; xte -x display 'key k';command but this one run gedit only(without typing the k char). Can some one chip in me?
我尝试从终端运行 gedit 并在那里打开的文件中键入一些文本,但没有成功。我尝试使用gedit; sleep 2; xte -x display 'key k';命令,但这个命令只运行 gedit(不输入 k 字符)。可以给我一点筹码吗?

