【发布时间】:2021-04-21 18:45:29
【问题描述】:
我查看了fish 文档,但没有找到我需要的东西(或者如果我找到了,我不明白)。
我在fish 中创建了一个函数,它会在一段时间后暂停我的电脑:
function ss --d 'sleeps the pc after specified time'
sleep $argv && systemctl suspend
end
然后我输入ss 20s,它会在 20 秒内关闭电脑。
但是如果我想将标志传递给systemctl suspend 怎么办?在函数中的该命令之后是否还需要$argv?
我确实尝试过类似的方法,但我收到了 Too many arguments 错误。
【问题讨论】:
标签: fish