Magento 2 : Run command line without prompt confirmation





.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty{ margin-bottom:0;
}







1















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?










share|improve this question

























  • Please do remember to accept the answer if it solved your issue.

    – Vivek Kumar
    Aug 23 '18 at 15:06


















1















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?










share|improve this question

























  • Please do remember to accept the answer if it solved your issue.

    – Vivek Kumar
    Aug 23 '18 at 15:06














1












1








1








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?










share|improve this question
















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?







magento2 magento2.2 cli command-line command






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Aug 23 '18 at 15:35









Vivek Kumar

2,5772729




2,5772729










asked Aug 23 '18 at 14:44









Elzo ValugiElzo Valugi

1408




1408













  • Please do remember to accept the answer if it solved your issue.

    – Vivek Kumar
    Aug 23 '18 at 15:06



















  • Please do remember to accept the answer if it solved your issue.

    – Vivek Kumar
    Aug 23 '18 at 15:06

















Please do remember to accept the answer if it solved your issue.

– Vivek Kumar
Aug 23 '18 at 15:06





Please do remember to accept the answer if it solved your issue.

– Vivek Kumar
Aug 23 '18 at 15:06










2 Answers
2






active

oldest

votes


















2














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





share|improve this answer































    0














    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.






    share|improve this answer








    New contributor




    Tom Voss is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
    Check out our Code of Conduct.





















      Your Answer








      StackExchange.ready(function() {
      var channelOptions = {
      tags: "".split(" "),
      id: "479"
      };
      initTagRenderer("".split(" "), "".split(" "), channelOptions);

      StackExchange.using("externalEditor", function() {
      // Have to fire editor after snippets, if snippets enabled
      if (StackExchange.settings.snippets.snippetsEnabled) {
      StackExchange.using("snippets", function() {
      createEditor();
      });
      }
      else {
      createEditor();
      }
      });

      function createEditor() {
      StackExchange.prepareEditor({
      heartbeatType: 'answer',
      autoActivateHeartbeat: false,
      convertImagesToLinks: false,
      noModals: true,
      showLowRepImageUploadWarning: true,
      reputationToPostImages: null,
      bindNavPrevention: true,
      postfix: "",
      imageUploader: {
      brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
      contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
      allowUrls: true
      },
      onDemand: true,
      discardSelector: ".discard-answer"
      ,immediatelyShowMarkdownHelp:true
      });


      }
      });














      draft saved

      draft discarded


















      StackExchange.ready(
      function () {
      StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmagento.stackexchange.com%2fquestions%2f239379%2fmagento-2-run-command-line-without-prompt-confirmation%23new-answer', 'question_page');
      }
      );

      Post as a guest















      Required, but never shown

























      2 Answers
      2






      active

      oldest

      votes








      2 Answers
      2






      active

      oldest

      votes









      active

      oldest

      votes






      active

      oldest

      votes









      2














      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





      share|improve this answer




























        2














        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





        share|improve this answer


























          2












          2








          2







          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





          share|improve this answer













          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






          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered Aug 23 '18 at 14:57









          Vivek KumarVivek Kumar

          2,5772729




          2,5772729

























              0














              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.






              share|improve this answer








              New contributor




              Tom Voss is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
              Check out our Code of Conduct.

























                0














                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.






                share|improve this answer








                New contributor




                Tom Voss is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                Check out our Code of Conduct.























                  0












                  0








                  0







                  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.






                  share|improve this answer








                  New contributor




                  Tom Voss is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                  Check out our Code of Conduct.










                  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.







                  share|improve this answer








                  New contributor




                  Tom Voss is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                  Check out our Code of Conduct.









                  share|improve this answer



                  share|improve this answer






                  New contributor




                  Tom Voss is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                  Check out our Code of Conduct.









                  answered 6 hours ago









                  Tom VossTom Voss

                  11




                  11




                  New contributor




                  Tom Voss is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                  Check out our Code of Conduct.





                  New contributor





                  Tom Voss is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                  Check out our Code of Conduct.






                  Tom Voss is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                  Check out our Code of Conduct.






























                      draft saved

                      draft discarded




















































                      Thanks for contributing an answer to Magento Stack Exchange!


                      • Please be sure to answer the question. Provide details and share your research!

                      But avoid



                      • Asking for help, clarification, or responding to other answers.

                      • Making statements based on opinion; back them up with references or personal experience.


                      To learn more, see our tips on writing great answers.




                      draft saved


                      draft discarded














                      StackExchange.ready(
                      function () {
                      StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmagento.stackexchange.com%2fquestions%2f239379%2fmagento-2-run-command-line-without-prompt-confirmation%23new-answer', 'question_page');
                      }
                      );

                      Post as a guest















                      Required, but never shown





















































                      Required, but never shown














                      Required, but never shown












                      Required, but never shown







                      Required, but never shown

































                      Required, but never shown














                      Required, but never shown












                      Required, but never shown







                      Required, but never shown







                      Popular posts from this blog

                      What other Star Trek series did the main TNG cast show up in?

                      Berlina muro

                      Berlina aerponto