Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions exitCodeOperations/testswithoutif
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#!/bin/bash
param=1

[[ "$param" -eq 1 ]] && echo "logic operator && grabs the exit code of the [[ ]] test if return code eq 0\"sucess\" run the following commands"

[[ "$param" -eq 2 ]] || echo "logic operator && grabs the exit code of the [[ ]] test if return code ne 0 \"not sucess\" run the following commands"

[[ "$param" -eq 1 ]] &&( echo "this spwan a subshell if you need to run multiples commands" ;echo "if the previos operation was sucessfull")

[[ "$param" -eq 1 ]] && { echo "this doesn't spwan a subshell " ;echo "run multiples commands if the previos operation was sucessfull" ;}
4 changes: 2 additions & 2 deletions ifElse/case.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/bin/bash
read -p "Enter the answer in Y/N: " ANSWER
read -r -p "Enter the answer in Y/N: " ANSWER
case "$ANSWER" in
[yY] | [yY][eE][sS])
echo "The Answer is Yes :)"
Expand All @@ -10,4 +10,4 @@ case "$ANSWER" in
*)
echo "Invalid Answer :/"
;;
esac
esac
6 changes: 3 additions & 3 deletions practise1/prog10.sh
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
#!/bin/bash
function fileCount () {
LOC=$1
ls $LOC > outText.txt
ls "$LOC" > outText.txt
NUM_FILES=$(wc -w outText.txt)
echo $NUM_FILES
echo "$NUM_FILES"
}
fileCount /etc
fileCount /etc