Я хочу получить подтверждение пользователя перед выполнением команды.
Я перепробовал все методы здесь
.PHONY: rebuild validate
rebuild:
@echo "rebuilding cluster to previous stable state"
@echo "Do you wish to continue (y/n)?"
select yn in "Yes" "No"
case $yn in
Yes ) make validate;;
No ) exit;;
esac
validate:
.....
Я получаю следующую ошибку:
rebuilding cluster to previous stable state
Do you wish to continue (y/n)?
select yn in "Yes" "No"
/bin/sh: -c: line 1: syntax error: unexpected end of file
make: *** [rebuild] Error 2
EDIT
Попробовал:
rebuild:
@echo "rebuilding cluster to previous stable state"
@read -p "Are you sure? " -n 1 -r
@echo
if [[ REPLY =~ ^[Yy] ]]
then
make validate
fi
Ошибки с:
rebuilding cluster to previous stable state
Are you sure? y
if [[ REPLY =~ ^[Yy] ]]
/bin/sh: -c: line 1: syntax error: unexpected end of file
make: *** [rebuild] Error 2