小编Ant*_*Cas的帖子

编写一个从终端接收变量的 shell 脚本?(~$ 命令变量)

我正在编写一个 shell 脚本,它需要一段时间(以分钟为单位)并为该数量打开一个在线鸡蛋计时器。

#!/bin/bash
#Opens http://e.ggtimer.com/TIMEmin where TIME = number of minutes
TIME=5
xdg-open http://e.ggtimer.com/"$TIME"min
Run Code Online (Sandbox Code Playgroud)

当我运行上面的脚本时,它会打开网页http://e.ggtimer.com/5min 我想从终端设置时间。例如:

eggtimer 10
Run Code Online (Sandbox Code Playgroud)

会打开http://e.ggtimer.com/10min

谢谢!

bash shell-script

3
推荐指数
1
解决办法
276
查看次数

标签 统计

bash ×1

shell-script ×1