Simple image host.
選択できるのは25トピックまでです。 トピックは、先頭が英数字で、英数字とダッシュ('-')を使用した35文字以内のものにしてください。

mautore 352B

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