Magento 2 : Run command line without prompt confirmationHow to inject Magento 2 commands in custom command?Magento 2: Controlling M2 via command line – when and why to use each commandHow the “magento setup:store-config:set --base-url” command exactly works?Installing magento from command line errorsMagento 2: Nginx pub/static not autogenerating, only works with command line static-content:deployactivate full page caching using Varnish from command lineCommand line error stock magentomagento 2.2 where to paste command lineHow to Run magento 2 command without connect putty?SSH Command Line Error on fresh install of Magento 2.2.5 on Bitnami

Watching something be written to a file live with tail

What is going on with Captain Marvel's blood colour?

Can a rocket refuel on Mars from water?

Can one be a co-translator of a book, if he does not know the language that the book is translated into?

A reference to a well-known characterization of scattered compact spaces

1960's book about a plague that kills all white people

Could gravitational lensing be used to protect a spaceship from a laser?

How much of data wrangling is a data scientist's job?

What is the intuition behind short exact sequences of groups; in particular, what is the intuition behind group extensions?

Can a virus destroy the BIOS of a modern computer?

Alternative to sending password over mail?

UK: Is there precedent for the governments e-petition site changing the direction of a government decision?

intersection of two sorted vectors in C++

What's the difference between 'rename' and 'mv'?

Stopping power of mountain vs road bike

AES: Why is it a good practice to use only the first 16bytes of a hash for encryption?

Is it canonical bit space?

Has there ever been an airliner design involving reducing generator load by installing solar panels?

Brothers & sisters

Facing a paradox: Earnshaw's theorem in one dimension

Arrow those variables!

SSH "lag" in LAN on some machines, mixed distros

Does a druid starting with a bow start with no arrows?

Why are electrically insulating heatsinks so rare? Is it just cost?



Magento 2 : Run command line without prompt confirmation


How to inject Magento 2 commands in custom command?Magento 2: Controlling M2 via command line – when and why to use each commandHow the “magento setup:store-config:set --base-url” command exactly works?Installing magento from command line errorsMagento 2: Nginx pub/static not autogenerating, only works with command line static-content:deployactivate full page caching using Varnish from command lineCommand line error stock magentomagento 2.2 where to paste command lineHow to Run magento 2 command without connect putty?SSH Command Line Error on fresh install of Magento 2.2.5 on Bitnami






.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 5 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

                      Can not update quote_id field of “quote_item” table magento 2Magento 2.1 - We can't remove the item. (Shopping Cart doesnt allow us to remove items before becomes empty)Add value for custom quote item attribute using REST apiREST API endpoint v1/carts/cartId/items always returns error messageCorrect way to save entries to databaseHow to remove all associated quote objects of a customer completelyMagento 2 - Save value from custom input field to quote_itemGet quote_item data using quote id and product id filter in Magento 2How to set additional data to quote_item table from controller in Magento 2?What is the purpose of additional_data column in quote_item table in magento2Set Custom Price to Quote item magento2 from controller

                      Magento 2 disable Secret Key on URL's from terminal The Next CEO of Stack OverflowMagento 2 Shortcut/GUI tool to perform commandline tasks for windowsIn menu add configuration linkMagento oAuth : Generating access token and access secretMagento 2 security key issue in Third-Party API redirect URIPublic actions in admin controllersHow to Disable Cache in Custom WidgetURL Key not changing in Magento 2Product URL Key gets deleted when importing custom options - Magento 2Problem with reindex terminalMagento 2 - bin/magento Commands not working in Cpanel Terminal

                      Aasi (pallopeli) Navigointivalikko