How can I check if a directory exists in a Bash shell script?
In order to check if a directory exists in Bash using shorter forms, specify the “-d” option in brackets and append the command that you want to run if it succeeds. [[ -d directory ]] && echo "This directory exists!" [ -d directory ] && echo "This directory exists!"
o check if a directory exists in a shell script and is a directory use the following syntax: [ -d "/path/to/dir" ] && echo "Directory /path/to/dir exists." [ ! -d "/path/to/dir" ] && echo "Directory /path/to/dir DOES NOT exists."
Смотрите видео How can I check if a directory exists in a Bash shell script? онлайн без регистрации, длительностью часов минут секунд в хорошем качестве. Это видео добавил пользователь Max ProTips 13 Март 2021, не забудьте поделиться им ссылкой с друзьями и знакомыми, на нашем сайте его посмотрели 218 раз и оно понравилось 0 людям.