GNU 屏幕:程序员在 Readbuf 中引用 ` `?
命令在slurping中需要绝对路径。所以我需要程序员引用,因为我懒惰写长路径。我该如何使用它们:
^a :readbuf `pwd`/file
The commands need absolute paths in slurping. So I need programmer-quotes, because of laziness to write long paths. How can I use them like:
^a :readbuf `pwd`/file
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您的问题似乎假设可以以这种方式使用反引号。但是,
screen
似乎不支持:readbuf
命令中的反引号。它也不支持其他 shell 约定,例如用于主目录的~
或用于环境变量扩展的$XYZ
。当
screen
读取:readbuf
命令中命名的文件时,文件名是相对于screen
启动的当前目录,而不是当前目录活动窗口中显示的任何内容。这可能就是您发现绝对路径适合您的原因。尝试使用相对于您最初启动screen
的任何目录的文件名。更新:有关此答案的其他工作,请参阅:GNU Screen :环境变量
Your question seems to assume that it is possible to use backticks in this way. However,
screen
does not appear to support backticks in the:readbuf
command. It also does not support other shell conventions such as~
for home directory, or$XYZ
for environment variable expansions.When
screen
reads the file named in the:readbuf
command, the file name is relative to the current directory wherescreen
started, not the current directory of whatever is displayed in the active window. This might be why you found that absolute paths worked for you. Try using a filename relative to whatever directory you startedscreen
from originally.Update: For additional work on this answer, see: GNU Screen: Environment variables