Skip to content
Snippets Groups Projects
Commit 75d7b144 authored by Бирюлин Алексей Борисоаич's avatar Бирюлин Алексей Борисоаич
Browse files

Update file hm_2_1_1.sh

parent a2cec06d
Branches main
No related tags found
No related merge requests found
......@@ -5,4 +5,17 @@
2. В ней создать 25 пустых файлов Ch001.txt - Ch025.txt
3. Удалить файлы, которые кратны вашему номеру в списке. (Пример: номер в списке 3, Файлы на удаление Ch003.txt , Ch006.txt и т.д.)
EOF
#Ваш код ниже
\ No newline at end of file
#Ваш код ниже
mkdir -p book
for i in {1..25}
do
filename=$(printf "book/Ch%03d.txt" $i)
touch "$filename"
done
for i in {1..25}
do
if (( i % 2 == 0 )); then
filename=$(printf "book/Ch%03d.txt" $i)
rm -f "$filename"
fi
done
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment