From 079bbc06cd3c20f35d826db1f3d12271cade3b0b Mon Sep 17 00:00:00 2001 From: nikitadr Date: Thu, 17 Sep 2026 15:22:30 +0400 Subject: [PATCH] modifying reading --- lanit/script_1.sh | 29 +++-------------------------- 1 file changed, 3 insertions(+), 26 deletions(-) diff --git a/lanit/script_1.sh b/lanit/script_1.sh index d3b3fa8..a8eb505 100644 --- a/lanit/script_1.sh +++ b/lanit/script_1.sh @@ -66,20 +66,7 @@ fi } merg_and_del() { - if [ -d "$PWD/$userName/$alias/" ] - then - touch "$PWD/$userName/$alias/all_logs_$alias.log" - find "$PWD/$userName/$alias/" -type f -name "*.log" \ - -not -path "$PWD/$userName/$alias/all_logs_$alias.log" \ - | sort | while IFS= read -r file; do - name=$(basename "$(dirname "$file")") - name="${name/Test/Test }" - echo "=====$name=====" >> "$PWD/$userName/$alias/all_logs_$alias.log" - cat "$file" >> "$PWD/$userName/$alias/all_logs_$alias.log" - done - rm -rf "$PWD/$userName/$alias/"Test* - fi -echo "[Ok] Объединение log файлов и удаление артефактов тестирования завершено!" +echo "[Ok]" } if [ -z "$1" ]; @@ -88,7 +75,8 @@ then Done="No" while [ "$Done" = "No" ] do - read -p "Пожалуйста введите ваш USERNAME (A-Za-z0-9): " userName + echo -n "Пожалуйста введите ваш USERNAME (A-Za-z0-9): " + read userName if [ -z "$userName" ] || [[ "$userName" =~ [А-Яа-я\:\;\<\>\/\\\*\?\|\"\'\.\$\#\(\)\ \&] ]]; then echo -e "\n[ERROR] Некорректный USERNAME!" @@ -118,16 +106,6 @@ then Done="Yes" fi done -else - name_config=$1 - if [ -f "$name_config" ] - then - read_config "$name_config" - else - echo "[ERROR] Config файл \"$name_config\" не существует!" - exit 1 - fi - fi if ! [ -d "$PWD/$userName/$alias" ] @@ -167,5 +145,4 @@ do done pseudo_run_test -merg_and_del echo -e "\n[Ok] Скрипт отработал!" \ No newline at end of file