Compare commits
2 Commits
main
...
developmen
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
eb2aab9832 | ||
|
|
5cfc427fd0 |
3
myapp_logs/app.log
Normal file
3
myapp_logs/app.log
Normal file
@@ -0,0 +1,3 @@
|
||||
linie1
|
||||
linie2
|
||||
linie3
|
||||
17
myapp_logs/audit_logs.sh
Normal file
17
myapp_logs/audit_logs.sh
Normal file
@@ -0,0 +1,17 @@
|
||||
#! /bin/bash
|
||||
echo "Starting log files..."
|
||||
|
||||
for i in *
|
||||
do
|
||||
lines_number=$(wc -l < "$i")
|
||||
echo "File: $i"
|
||||
echo "Lines: $lines_number"
|
||||
if [[ ! -s "$i" ]]; then
|
||||
echo "Empty file!"
|
||||
elif [[ $(lines_number) -gt 100 ]]; then
|
||||
echo "Large files!"
|
||||
else
|
||||
echo "Normal file!"
|
||||
fi
|
||||
echo "----------------"
|
||||
done
|
||||
7
myapp_logs/error.log
Normal file
7
myapp_logs/error.log
Normal file
@@ -0,0 +1,7 @@
|
||||
error1
|
||||
error2
|
||||
error3
|
||||
error4
|
||||
error5
|
||||
error6
|
||||
|
||||
2
playground/README.md
Normal file
2
playground/README.md
Normal file
@@ -0,0 +1,2 @@
|
||||
### fun.sh ---------verifica fisierele dintr-un director si scrie un comentariu pentru fiecare------ ###
|
||||
#### ... for, if, elif, echo ####
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user