When I run:

bin/magento setup:config:set --http-cache-hosts=172.xx.xx.xx

I get a command prompt:

Overwrite the existing configuration for http-cache-hosts?[Y/n]

I want to use this into a bash script so I do not want user interaction.

I can do it by using a hackish way, but I do not like it:

yes Y | script.sh

Is there a way to force this to use the default value Y?

  • Please do remember to accept the answer if it solved your issue. – Vivek Kumar Aug 23 '18 at 15:06

You can use -n parameter to disable interactive mode and assume yes.

 -n, --no-interaction                                                                     Do not ask any interactive question

So, your final command will be

bin/magento setup:config:set --http-cache-hosts=172.xx.xx.xx -n

Magento documentation shows that appending -n or --no-interaction to your command should result in no interactive questions. However, in my real-world use of Magento 2.3.0 this has proven to not be the case. If I leave off the -n or --no-interaction parameters then my command is successful, though it does prompt with [Y/n]. If I include the -n or --no-interaction parameters then the command appears to succeed with no prompts. Unfortunately in reality none of the parameters end up succeeding. I don't currently have a workaround.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.