How to pass answers to bash script (composer-rest-server) options through text file?How do I know the script file name in a Bash script?How to iterate over arguments in a Bash scriptHow to check if a program exists from a Bash script?How do I tell if a regular file does not exist in Bash?How can I redirect and append both stdout and stderr to a file with Bash?Looping through the content of a file in BashHow can I write a heredoc to a file in Bash script?Check number of arguments passed to a Bash scriptError Composer Rest ServerIs uploading Business Network Cards to Composer REST servers a huge security flaw?

I have found ports on my Samsung smart tv running a display service. What can I do with it?

Bent arrow under a node

Can you place a web spell on a surface you cannot see?

How to avoid offending original culture when making conculture inspired from original

How can I ping multiple IP addresses at the same time?

What is the context for Napoleon's quote "[the Austrians] did not know the value of five minutes"?

Is this broken pipe the reason my freezer is not working? Can it be fixed?

How to make all magic-casting innate, but still rare?

How do credit card companies know what type of business I'm paying for?

Basic power tool set for Home repair and simple projects

Time at 1G acceleration to travel 100 000 light years

Is it a bad idea to have a pen name with only an initial for a surname?

How much steel armor can you wear and still be able to swim?

Is this a valid proof that A = B given A ∩ B = A ∪ B?

Why is it 出差去 and not 去出差?

Fantasy game inventory — Ch. 5 Automate the Boring Stuff

What does "vrit' mean with reference to documentaries?

Weird thing in 737 cabin

My student in one course asks for paid tutoring in another course. Appropriate?

How to address players struggling with simple controls?

Simplify, equivalent for (p ∨ ¬q) ∧ (¬p ∨ ¬q)

How to make a villain when your PCs are villains?

Boundaries and Buddhism

Explicit song lyrics checker



How to pass answers to bash script (composer-rest-server) options through text file?


How do I know the script file name in a Bash script?How to iterate over arguments in a Bash scriptHow to check if a program exists from a Bash script?How do I tell if a regular file does not exist in Bash?How can I redirect and append both stdout and stderr to a file with Bash?Looping through the content of a file in BashHow can I write a heredoc to a file in Bash script?Check number of arguments passed to a Bash scriptError Composer Rest ServerIs uploading Business Network Cards to Composer REST servers a huge security flaw?






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty height:90px;width:728px;box-sizing:border-box;








0















This a question regarding composer-rest-server which opens a terminal & accepts user input for initialisation. For running the apps created using hyperledger one should launch composer-playground and composer-rest-server. Now consider the scenario where in we have to run the app in the server. For that we need to run both as a background service. The nohup option works for the composer-playground as there is nothing for the user to give as input but this fails in the case of the composer-rest-server where the user needs to give input as shown in the picture below:



Normal running



Now I tried to run this as a background service by passing the answers to the options through a text file. Each line of the text file will have the options which I type in the terminal.



admin@test-network
^[[B ^[[A n
n
n
n
n
n
n


The first option works fine but I am stuck in the second option which is to select the "always use namespaces" from the multiple choice.



enter image description here



In normal running, after typing the first option(admin@test-network) I would press enter key to select the first choice from the multiple choice(of the second option) and then move on towards the remaining options. I have tried passing the following for the second option:



  • New line character n.

  • Carriage return r.

  • Simulate down keystroke ^[[B & up keystroke ^[[A to come back to the first choice and pressing enter by passing n.

Nothing seems to be working. Can anyone give suggestions on how to bypass this or another efficient way ?










share|improve this question






























    0















    This a question regarding composer-rest-server which opens a terminal & accepts user input for initialisation. For running the apps created using hyperledger one should launch composer-playground and composer-rest-server. Now consider the scenario where in we have to run the app in the server. For that we need to run both as a background service. The nohup option works for the composer-playground as there is nothing for the user to give as input but this fails in the case of the composer-rest-server where the user needs to give input as shown in the picture below:



    Normal running



    Now I tried to run this as a background service by passing the answers to the options through a text file. Each line of the text file will have the options which I type in the terminal.



    admin@test-network
    ^[[B ^[[A n
    n
    n
    n
    n
    n
    n


    The first option works fine but I am stuck in the second option which is to select the "always use namespaces" from the multiple choice.



    enter image description here



    In normal running, after typing the first option(admin@test-network) I would press enter key to select the first choice from the multiple choice(of the second option) and then move on towards the remaining options. I have tried passing the following for the second option:



    • New line character n.

    • Carriage return r.

    • Simulate down keystroke ^[[B & up keystroke ^[[A to come back to the first choice and pressing enter by passing n.

    Nothing seems to be working. Can anyone give suggestions on how to bypass this or another efficient way ?










    share|improve this question


























      0












      0








      0








      This a question regarding composer-rest-server which opens a terminal & accepts user input for initialisation. For running the apps created using hyperledger one should launch composer-playground and composer-rest-server. Now consider the scenario where in we have to run the app in the server. For that we need to run both as a background service. The nohup option works for the composer-playground as there is nothing for the user to give as input but this fails in the case of the composer-rest-server where the user needs to give input as shown in the picture below:



      Normal running



      Now I tried to run this as a background service by passing the answers to the options through a text file. Each line of the text file will have the options which I type in the terminal.



      admin@test-network
      ^[[B ^[[A n
      n
      n
      n
      n
      n
      n


      The first option works fine but I am stuck in the second option which is to select the "always use namespaces" from the multiple choice.



      enter image description here



      In normal running, after typing the first option(admin@test-network) I would press enter key to select the first choice from the multiple choice(of the second option) and then move on towards the remaining options. I have tried passing the following for the second option:



      • New line character n.

      • Carriage return r.

      • Simulate down keystroke ^[[B & up keystroke ^[[A to come back to the first choice and pressing enter by passing n.

      Nothing seems to be working. Can anyone give suggestions on how to bypass this or another efficient way ?










      share|improve this question
















      This a question regarding composer-rest-server which opens a terminal & accepts user input for initialisation. For running the apps created using hyperledger one should launch composer-playground and composer-rest-server. Now consider the scenario where in we have to run the app in the server. For that we need to run both as a background service. The nohup option works for the composer-playground as there is nothing for the user to give as input but this fails in the case of the composer-rest-server where the user needs to give input as shown in the picture below:



      Normal running



      Now I tried to run this as a background service by passing the answers to the options through a text file. Each line of the text file will have the options which I type in the terminal.



      admin@test-network
      ^[[B ^[[A n
      n
      n
      n
      n
      n
      n


      The first option works fine but I am stuck in the second option which is to select the "always use namespaces" from the multiple choice.



      enter image description here



      In normal running, after typing the first option(admin@test-network) I would press enter key to select the first choice from the multiple choice(of the second option) and then move on towards the remaining options. I have tried passing the following for the second option:



      • New line character n.

      • Carriage return r.

      • Simulate down keystroke ^[[B & up keystroke ^[[A to come back to the first choice and pressing enter by passing n.

      Nothing seems to be working. Can anyone give suggestions on how to bypass this or another efficient way ?







      bash shell hyperledger hyperledger-composer






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Mar 27 at 3:50







      Sooraj

















      asked Mar 25 at 5:12









      SoorajSooraj

      16416




      16416






















          1 Answer
          1






          active

          oldest

          votes


















          0














          Use command composer-rest-server -c <card name> -p <port number> Hope it helpful






          share|improve this answer























          • But isn't that command used to restart the rest server? My doubt is how to start the server provided you are given a headless server. For gui based vm like in Amazon EC2 its fine. You can use remote desktop to access it and then start the terminal and keep it minimised. But in the case of headless, as soon as the terminal shut off / internet gets disconnected in the client machine it gets disconnected. Not truly a background service.

            – Sooraj
            Mar 27 at 6:33











          • nohup composer-rest-server -c <card name> -n always -w true -p <port number> > rest-server.out 2> rest-server.err < /dev/null &

            – salman faris
            Mar 27 at 6:36











          Your Answer






          StackExchange.ifUsing("editor", function ()
          StackExchange.using("externalEditor", function ()
          StackExchange.using("snippets", function ()
          StackExchange.snippets.init();
          );
          );
          , "code-snippets");

          StackExchange.ready(function()
          var channelOptions =
          tags: "".split(" "),
          id: "1"
          ;
          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: true,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: 10,
          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%2fstackoverflow.com%2fquestions%2f55331567%2fhow-to-pass-answers-to-bash-script-composer-rest-server-options-through-text-f%23new-answer', 'question_page');

          );

          Post as a guest















          Required, but never shown

























          1 Answer
          1






          active

          oldest

          votes








          1 Answer
          1






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes









          0














          Use command composer-rest-server -c <card name> -p <port number> Hope it helpful






          share|improve this answer























          • But isn't that command used to restart the rest server? My doubt is how to start the server provided you are given a headless server. For gui based vm like in Amazon EC2 its fine. You can use remote desktop to access it and then start the terminal and keep it minimised. But in the case of headless, as soon as the terminal shut off / internet gets disconnected in the client machine it gets disconnected. Not truly a background service.

            – Sooraj
            Mar 27 at 6:33











          • nohup composer-rest-server -c <card name> -n always -w true -p <port number> > rest-server.out 2> rest-server.err < /dev/null &

            – salman faris
            Mar 27 at 6:36















          0














          Use command composer-rest-server -c <card name> -p <port number> Hope it helpful






          share|improve this answer























          • But isn't that command used to restart the rest server? My doubt is how to start the server provided you are given a headless server. For gui based vm like in Amazon EC2 its fine. You can use remote desktop to access it and then start the terminal and keep it minimised. But in the case of headless, as soon as the terminal shut off / internet gets disconnected in the client machine it gets disconnected. Not truly a background service.

            – Sooraj
            Mar 27 at 6:33











          • nohup composer-rest-server -c <card name> -n always -w true -p <port number> > rest-server.out 2> rest-server.err < /dev/null &

            – salman faris
            Mar 27 at 6:36













          0












          0








          0







          Use command composer-rest-server -c <card name> -p <port number> Hope it helpful






          share|improve this answer













          Use command composer-rest-server -c <card name> -p <port number> Hope it helpful







          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered Mar 27 at 6:13









          salman farissalman faris

          571113




          571113












          • But isn't that command used to restart the rest server? My doubt is how to start the server provided you are given a headless server. For gui based vm like in Amazon EC2 its fine. You can use remote desktop to access it and then start the terminal and keep it minimised. But in the case of headless, as soon as the terminal shut off / internet gets disconnected in the client machine it gets disconnected. Not truly a background service.

            – Sooraj
            Mar 27 at 6:33











          • nohup composer-rest-server -c <card name> -n always -w true -p <port number> > rest-server.out 2> rest-server.err < /dev/null &

            – salman faris
            Mar 27 at 6:36

















          • But isn't that command used to restart the rest server? My doubt is how to start the server provided you are given a headless server. For gui based vm like in Amazon EC2 its fine. You can use remote desktop to access it and then start the terminal and keep it minimised. But in the case of headless, as soon as the terminal shut off / internet gets disconnected in the client machine it gets disconnected. Not truly a background service.

            – Sooraj
            Mar 27 at 6:33











          • nohup composer-rest-server -c <card name> -n always -w true -p <port number> > rest-server.out 2> rest-server.err < /dev/null &

            – salman faris
            Mar 27 at 6:36
















          But isn't that command used to restart the rest server? My doubt is how to start the server provided you are given a headless server. For gui based vm like in Amazon EC2 its fine. You can use remote desktop to access it and then start the terminal and keep it minimised. But in the case of headless, as soon as the terminal shut off / internet gets disconnected in the client machine it gets disconnected. Not truly a background service.

          – Sooraj
          Mar 27 at 6:33





          But isn't that command used to restart the rest server? My doubt is how to start the server provided you are given a headless server. For gui based vm like in Amazon EC2 its fine. You can use remote desktop to access it and then start the terminal and keep it minimised. But in the case of headless, as soon as the terminal shut off / internet gets disconnected in the client machine it gets disconnected. Not truly a background service.

          – Sooraj
          Mar 27 at 6:33













          nohup composer-rest-server -c <card name> -n always -w true -p <port number> > rest-server.out 2> rest-server.err < /dev/null &

          – salman faris
          Mar 27 at 6:36





          nohup composer-rest-server -c <card name> -n always -w true -p <port number> > rest-server.out 2> rest-server.err < /dev/null &

          – salman faris
          Mar 27 at 6:36



















          draft saved

          draft discarded
















































          Thanks for contributing an answer to Stack Overflow!


          • 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%2fstackoverflow.com%2fquestions%2f55331567%2fhow-to-pass-answers-to-bash-script-composer-rest-server-options-through-text-f%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

          Obelisk of Theodosius Contents History Description Notes Bibliography Further reading External links Navigation menuAge of spirituality : late antique and early Christian art, third to seventh centuryOver 60 picturesObelisks of the World41°00′21.24″N 28°58′31.43″E / 41.0059000°N 28.9753972°E / 41.0059000; 28.97539727724550-7235741376235741376

          밀양 대씨 역사 각주 함께 보기 둘러보기 메뉴밀양 대씨

          1973년 목차 사건 문화 탄생 사망 노벨상 달력 둘러보기 메뉴