linux - 程序在输入之前启动
问题描述
man -k . | fzf -e --tiebreak=begin | awk '{print $1}' | xargs man -Tpdf | zathura -
# searches for a man page and then outputs it as pdf to zathura
这是命令,它工作得很好,除了 zathura 在等待标准输入给它输入时开始空白。必须将焦点从 zathura 转移回终端,然后再回到 zathura,这真的很烦人。
我对脚本相当陌生,所以我认为可能有一种我不知道的解决方法。
不管怎么说,还是要谢谢你!
解决方案
我“解决”了我的问题,我将输出重定向到我的 /tmp/ 目录,然后从那里读取 zathura。我也把它全部放在一个脚本中。
#!/bin/sh
d=$(date +'%M_%S');
man -k . | fzf -e --tiebreak=begin | awk '{print $1}' | xargs man -Tpdf > /tmp/man_${d};
zathura /tmp/man_${d} 2> /dev/null &
推荐阅读
- flutter - 当 DraggableScrollableSheet 为屏幕的 0.95% 时更改 ClipRRect 边框半径
- c# - 为团队自定义应用程序大纲添加不同的图标?
- c - 为什么这段代码在没有 int main() 的情况下运行
- java - SSL 握手异常:“目标证书约束检查失败”
- javascript - 我的 JavaScript 无法在表格中进行搜索
- javascript - 我的 javascript Show and hide 代码不起作用?
- kotlin - 如何在 Kotlin 中使用这样的行?
- applescript - 打开非法 pptx 文件后 AppleScript Keynote 挂断
- java - 连接 android app 和 web manager 之间的 api
- angular - 我们如何从 Angular 中的 JSON 类型数据中删除大括号 {} 和双引号“”?