Difference between revisions of "While ... do"

From wikieduonline
Jump to navigation Jump to search
 
(2 intermediate revisions by the same user not shown)
Line 10: Line 10:
  
 
  while true; do [[tput bel]]; [[sleep]] 5; done
 
  while true; do [[tput bel]]; [[sleep]] 5; done
 +
 +
[[Response time]]:
 +
while true; do echo "Time_total"; curl -so /dev/null -w '%{time_total}\n' test.wikieduonline.com; sleep 1;  done
  
 
[[Fish shell]]:
 
[[Fish shell]]:

Latest revision as of 07:34, 21 January 2025

wikipedia:While


#!/bin/bash
while true; do
  ((my_var++))
  echo $my_var
done
while true; do tput bel; sleep 5; done

Response time:

while true; do echo "Time_total"; curl -so /dev/null -w '%{time_total}\n' test.wikieduonline.com; sleep 1;  done

Fish shell:

while CONDITION; COMMANDS; end


  • cat your_file.txt | while read i; do echo "YOUR_TEXT $i"; done
  • cat your_file.txt | while read i; do echo "$(date) $i"; done


Related terms[edit]

See also[edit]

Advertising: