diff --git a/0x04-loops_conditions_and_parsing/1-for_best_school b/0x04-loops_conditions_and_parsing/1-for_best_school old mode 100644 new mode 100755 index e69de29..f566e75 --- a/0x04-loops_conditions_and_parsing/1-for_best_school +++ b/0x04-loops_conditions_and_parsing/1-for_best_school @@ -0,0 +1,7 @@ +#!/usr/bin/env bash +#This script prints "Best School" 10 times + +for _ in {1..10}; +do + echo "Best School" +done diff --git a/0x04-loops_conditions_and_parsing/10-fizzbuzz b/0x04-loops_conditions_and_parsing/10-fizzbuzz old mode 100644 new mode 100755 diff --git a/0x04-loops_conditions_and_parsing/2-while_best_school b/0x04-loops_conditions_and_parsing/2-while_best_school old mode 100644 new mode 100755 index e69de29..646f165 --- a/0x04-loops_conditions_and_parsing/2-while_best_school +++ b/0x04-loops_conditions_and_parsing/2-while_best_school @@ -0,0 +1,9 @@ +#!/usr/bin/env bash +#This script prints "Best School" 10 times + +n=0 +while [ $n -lt 10 ]; +do + echo "Best School" + ((n++)) +done diff --git a/0x04-loops_conditions_and_parsing/3-until_best_school b/0x04-loops_conditions_and_parsing/3-until_best_school old mode 100644 new mode 100755 index e69de29..a39c532 --- a/0x04-loops_conditions_and_parsing/3-until_best_school +++ b/0x04-loops_conditions_and_parsing/3-until_best_school @@ -0,0 +1,9 @@ +#!/usr/bin/env bash +#This script prints "Best School" 10 times + +n=0 +until [ $n == 10 ]; +do + echo "Best School" + ((n++)) +done diff --git a/0x04-loops_conditions_and_parsing/4-if_9_say_hi b/0x04-loops_conditions_and_parsing/4-if_9_say_hi old mode 100644 new mode 100755 index e69de29..1348310 --- a/0x04-loops_conditions_and_parsing/4-if_9_say_hi +++ b/0x04-loops_conditions_and_parsing/4-if_9_say_hi @@ -0,0 +1,13 @@ +#!/usr/bin/env bash +#displays Best School 10 times, but for the 9th iteration, displays Best School and then Hi on a new line + +n=0 +while [ $n -lt 10 ]; +do + echo "Best School" + if [ $n == 8 ]; + then + echo "Hi" + fi + ((n++)) +done diff --git a/0x04-loops_conditions_and_parsing/5-4_bad_luck_8_is_your_chance b/0x04-loops_conditions_and_parsing/5-4_bad_luck_8_is_your_chance old mode 100644 new mode 100755 index e69de29..1d839bc --- a/0x04-loops_conditions_and_parsing/5-4_bad_luck_8_is_your_chance +++ b/0x04-loops_conditions_and_parsing/5-4_bad_luck_8_is_your_chance @@ -0,0 +1,15 @@ +#!/usr/bin/env bash +# script that loops from 1 to 10 +n=1 + +while [ $n -le 10 ]; +do + if [ $n == 4 ]; then + echo "bad luck" + elif [ $n == 8 ]; then + echo "good luck" + else + echo "Best School" + fi; + ((n++)) +done diff --git a/0x04-loops_conditions_and_parsing/6-superstitious_numbers b/0x04-loops_conditions_and_parsing/6-superstitious_numbers old mode 100644 new mode 100755 index e69de29..835e74f --- a/0x04-loops_conditions_and_parsing/6-superstitious_numbers +++ b/0x04-loops_conditions_and_parsing/6-superstitious_numbers @@ -0,0 +1,18 @@ +#!/usr/bin/env bash +# script that loops from 1 to 10 +n=1 + +while [ $n -le 20 ]; +do + case $n in + 4) echo "bad luck from China" + ;; + 9) echo "bad luck from Japan" + ;; + 17) echo "bad luck from Italy" + ;; + *) echo $n + ;; + esac + ((n++)) +done diff --git a/0x04-loops_conditions_and_parsing/7-clock b/0x04-loops_conditions_and_parsing/7-clock old mode 100644 new mode 100755 index e69de29..eae83f5 --- a/0x04-loops_conditions_and_parsing/7-clock +++ b/0x04-loops_conditions_and_parsing/7-clock @@ -0,0 +1,17 @@ +#!/usr/bin/env bash +# script that displays the time for 12 hours and 59 minutes + +sec=0 +hr=0 + +while [ $hr -le 12 ]; +do + sec=0 + echo "Hour: $hr" + while [ $sec -le 59 ]; + do + echo $sec + ((sec++)) + done + ((hr++)) +done diff --git a/0x04-loops_conditions_and_parsing/8-for_ls b/0x04-loops_conditions_and_parsing/8-for_ls old mode 100644 new mode 100755 diff --git a/0x04-loops_conditions_and_parsing/9-to_file_or_not_to_file b/0x04-loops_conditions_and_parsing/9-to_file_or_not_to_file old mode 100644 new mode 100755