GNU 屏幕:程序员在 Readbuf 中引用 ` `?

发布于 2024-08-02 10:28:00 字数 216 浏览 3 评论 0原文

命令在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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

花心好男孩 2024-08-09 10:28:00

您的问题似乎假设可以以这种方式使用反引号。但是,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 where screen 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 started screen from originally.

Update: For additional work on this answer, see: GNU Screen: Environment variables

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文