You need to write a script that displays the user name, home directory. Adds all home directory files to the archive. If an archive with the same name already exists, then print a warning.
#! /bin/bash who=$(whoami); echo "Пользователь системы: $who"; echo "Домашний каталог: $HOME"; first=$(ls *back_up_name_$(date +%A).zip*); second="back_up_name_$(date +%A).zip"; if [ $first -eq $second ]; then read -p "Переписать файл? (1/0)" choise; if [$choise -eq 1]; then zip back_up_name_$(date +%A).zip else exit 0 fi else zip back_up_name_$(date +%A).zip; fi exit 0; It does not work correctly, I can not figure out why.
if [ -f имя_файла ]- Mike