Simple image host.
您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

123456789101112131415161718192021222324252627
  1. #!/bin/bash
  2. DIR="."
  3. CMD="$1"
  4. $CMD &
  5. PID=$!
  6. OLD=$(ls -R --full-time "$DIR")
  7. while :; do
  8. NEW=$(ls -R --full-time "$DIR")
  9. if [ "$OLD" != "$NEW" ]; then
  10. OLD=$(ls -R --full-time "$DIR")
  11. kill -9 "$PID" > /dev/null
  12. [ $? != "0" ] && echo "Process $PID doesn't exist."
  13. $CMD &
  14. PID=$!
  15. # Print bell character
  16. echo -e "\a"
  17. fi
  18. sleep 1
  19. done