Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
想自动显示一个好的天气报告
curl wttr.in/bydgoszcz
天气预报
从系统菜单启动这样的脚本:
#!/bin/sh exec io.elementary.terminal -e "curl wttr.in/bydgoszcz"
但是这样输出有点“不完整”,就像命令执行得太快一样(注意这里的user@machine行的位置):
user@machine
脚本中的天气报告
那么,有没有办法在-eflag 之后延迟命令?
-e
或者也许完全不同的方法会自动执行此操作以正确显示输出?
我不确定,但试试这个
exec io.elementary.terminal -e "sleep1s & curl wttr.in/bydgoszcz"
将
#!/bin/sh WTTR=$(curl -s wttr.in/bydgoszcz) && \ exec io.elementary.terminal -e "echo $WTTR"
解决这个问题?