From 186f9c015a681362bf76dd644a645b75e2aea1bc Mon Sep 17 00:00:00 2001 From: rulanugrh Date: Wed, 2 Oct 2024 21:55:50 +0700 Subject: [PATCH] chore: update all file and code --- .github/workflows/testing_shell.yml | 6 +++--- advance/00_regex/regex.sh | 2 +- advance/03_user_administration/user_administration.sh | 8 ++++---- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/.github/workflows/testing_shell.yml b/.github/workflows/testing_shell.yml index 7052835..9bc81c9 100644 --- a/.github/workflows/testing_shell.yml +++ b/.github/workflows/testing_shell.yml @@ -14,7 +14,7 @@ jobs: run: | d=$(date "+%Y-%m-%d") file="/tmp/test.txt.$$" && touch --date "$d" "$file" - echo $file && find . -iname "*.sh" -type f -newer $file > output.txt - for i in $(cat output.txt); do chmod +x $i && bash $i; done - + echo $file && find . -type d \( -path ./playground -o -path ./simple_project -o -path ./basic -o -path ./usefull_command \) -prune -o -iname "*.sh" -type f -newer $file > output.txt + for i in $(cat output.txt); do if [ -d "$i" ]; then echo "$i adalah folder."; elif [ -f "$i" ]; chmod +x "$i" && bash "$i"; else echo "$i tidak ditemukan atau bukan file/folder."; fi; done + - run: echo "status ${{ job.status }}" diff --git a/advance/00_regex/regex.sh b/advance/00_regex/regex.sh index c7d6660..cef6af8 100755 --- a/advance/00_regex/regex.sh +++ b/advance/00_regex/regex.sh @@ -1 +1 @@ -awk -e '$1 ~ /p[o]/ {print $0}' buah.txt \ No newline at end of file +awk -e '$1 ~ /p[o]/ {print $0}' ./advance/00_regex/buah.txt \ No newline at end of file diff --git a/advance/03_user_administration/user_administration.sh b/advance/03_user_administration/user_administration.sh index 1d0b1ed..1362e74 100644 --- a/advance/03_user_administration/user_administration.sh +++ b/advance/03_user_administration/user_administration.sh @@ -14,13 +14,13 @@ check_os() { esac } -if ["$(dpkg -l | awk '/sudo/ {print }' | wc -l)" -le 1]; then - check_os() - sleep 5 +if [ "$(dpkg -l | awk '/sudo/ {print }' | wc -l)" -le 1 ]; +then + check_os +fi echo -e "create new user kyora ..." useradd kyora && echo -e "1\n\1n" | passwd kyora -sleep 2 echo -e "add kyora to sudoers ..." usermod -aG sudo kyora \ No newline at end of file