相关疑难解决方法(0)

复制 Terminal.app 中最后一个命令的输出

!! | pbcopy 还会再次运行命令,并且不能与交互式命令一起使用。

这依赖于提示始终是$

tell application "Terminal" to tell window 1 to history
do shell script "/bin/echo " & quoted form of result & ¬
    " | ruby -e 'puts $<.read.split(/^\\$ .*?$/)[-2][1..-1]'"
set the clipboard to result
Run Code Online (Sandbox Code Playgroud)

有人知道更好的选择吗?

terminal bash macos

8
推荐指数
1
解决办法
4957
查看次数

标签 统计

bash ×1

macos ×1

terminal ×1