Preloader image
DDD

Java TIP

Linux - Loop bash script

작성자 관리자 (admin)
조회수 69
입력일 2020-01-30 22:25:19

-- sample 1 --

#!/bin/sh
COUNT=10

while [ $COUNT -gt 0 ]; do

  echo COUNT : $COUNT
  ls -al ./dir
  w
  let COUNT=COUNT-1
  tmout=0
  echo "----------------"
  sleep 2

done

-- sample 2 --

#!/bin/bash
while :
do
    echo "Press [CTRL+C] to stop.."
    sleep 1
done

^