脚本帮助在设定的时间后关闭程序

脚本帮助在设定的时间后关闭程序

这不太正常。

#!/bin/bash
[ ! $1 ] && { echo -e "Error!! No time given.!!"; exit 1; }
seamonkey
sleep $1
killall seamonkey

2018 年 7 月 20 日

#!/bin/bash
#
# Originally by pavlos_kairis
#
# Open Seamonkey for a specified amount of time and then terminate program
if [ $# -eq 0 ]; then
  echo "Error! no time given."
  echo "Syntax:"
  echo 
  echo "15s = 15 seconds"
  echo "1m = 1 minute"
  echo "1h = 1 hr"
  exit 1
fi
echo "Opening Seamonkey ..."
seamonkey  &
sleep $1
echo "Seamonkey will close in " $1
killall seamonkey

相关内容