From 5cfc427fd06f5660340839088f8977f8ad3915f1 Mon Sep 17 00:00:00 2001 From: Daniela_M Date: Sun, 14 Dec 2025 08:12:00 +0000 Subject: [PATCH] IF statements added --- playground/README.md | 2 ++ playground/fun.sh | 13 +++++++++++-- 2 files changed, 13 insertions(+), 2 deletions(-) create mode 100644 playground/README.md diff --git a/playground/README.md b/playground/README.md new file mode 100644 index 0000000..e625de6 --- /dev/null +++ b/playground/README.md @@ -0,0 +1,2 @@ +### fun.sh ---------verifica fisierele dintr-un director si scrie un comentariu pentru fiecare------ ### +#### ... for, if, elif, echo #### diff --git a/playground/fun.sh b/playground/fun.sh index e52a8ca..8567ee7 100644 --- a/playground/fun.sh +++ b/playground/fun.sh @@ -2,6 +2,15 @@ echo "Robotul analizaeaza fisierele..." for i in * do - echo "File: $f" -done + echo "File: $i" + if [[ "$i" == *.sh ]]; then + echo "Script magic detectat!"; + elif [ ! -s "$i" ]; then + echo "Nu te pot ajuta cu nimic, sunt gol!" + else + echo "Contin secrete!"; + fi + + echo "-----------------" +done