Answer the question
In order to leave comments, you need to log in
Completion of the folder creation script?
Good afternoon. Help to finalize the folder creation script. The script should ask the user with what name to create a folder. And check before creating: if the folder exists, then you must offer to enter the folder name again, respectively, if there is no such folder, then create it and exit.
The script itself:
#!/bin/bash
PARENT_DIR=$HOME
echo "Укажите имя папки:"
read DIRNAME
...
понимаю что тут должно быть что-то такое
while true
do
case $DIRNAME in
$PARENT_DIR )
echo "Папка есть. Введите другое имя"
;;
mkdir $DIRNAME
esac
done
...
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question