Linux Shell Loop : For (5x), While (endless) - One Line / Multiline

While (endless, stop: CTRL+C)

while : 
 do 
  date
  echo "Hello "
  sleep 5
 done

Alternativ:

while : ; do date; echo "Hello "; sleep 6; done

 

For (5x):

for i in {1..5}
do
   echo "Number is $i "
   sleep 2
done

 Alternativ 1:

for i in {1..5}; do echo "Number is $i "; sleep 2; done

 

 Alternativ 2:

for i in {1..5}; do echo "Number is $i " && sleep 2; done

 

 

Comments

Alle VHosts aktualisieren:

for i in /var/www/vhosts/*/httpdocs/; do printf "\n\n\n $i :\n";   cd $i; pwd; drush status; composer update --dry-run; done

 

Neuen Kommentar schreiben

CAPTCHA
This question is for testing whether or not you are a human visitor and to prevent automated spam submissions.

Suche

Neueste Kommentare