User Tools

Site Tools


ops102:bash_scripting_2_-_loops

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
ops102:bash_scripting_2_-_loops [2024/03/14 19:00] chrisops102:bash_scripting_2_-_loops [2025/03/11 03:54] (current) – [tput Colour Codes] chris
Line 1: Line 1:
 ====== Bash Scripting 2: Loops ====== ====== Bash Scripting 2: Loops ======
  
-===== Video ===== 
- 
-[[https://seneca-my.sharepoint.com/:v:/g/personal/chris_tyler_senecapolytechnic_ca/EVD6JDdK6TFCi52TQAiY6C8BdoDDANaEi8P1pt3TH4xH8w?e=Up7yKF|Video Lecture]] 
  
 ===== Looping in Bash ====== ===== Looping in Bash ======
Line 107: Line 104:
   do   do
   tput setaf $C   # Set foreground to colour $C   tput setaf $C   # Set foreground to colour $C
-  echo "This is colour $C"+  echo "Colour $C"
   done   done
   tput sgr0   # Reset to "normal" text mode   tput sgr0   # Reset to "normal" text mode
Line 140: Line 137:
   SECRET=$(( RANDOM % MAX + 1 ))    SECRET=$(( RANDOM % MAX + 1 ))
      
-        # Un-commend this line when debugging!+        # Un-comment this line when debugging!
         # echo "NOTE: the secret number is $SECRET"         # echo "NOTE: the secret number is $SECRET"
      
ops102/bash_scripting_2_-_loops.1710442843.txt.gz · Last modified: 2024/04/16 18:10 (external edit)

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki