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

          Kamusi Yaliyomo Aina za kamusi | Muundo wa kamusi | Faida za kamusi | Dhima ya picha katika kamusi | Marejeo | Tazama pia | Viungo vya nje | UrambazajiKuhusu kamusiGo-SwahiliWiki-KamusiKamusi ya Kiswahili na Kiingerezakuihariri na kuongeza habari

          SQL error code 1064 with creating Laravel foreign keysForeign key constraints: When to use ON UPDATE and ON DELETEDropping column with foreign key Laravel error: General error: 1025 Error on renameLaravel SQL Can't create tableLaravel Migration foreign key errorLaravel php artisan migrate:refresh giving a syntax errorSQLSTATE[42S01]: Base table or view already exists or Base table or view already exists: 1050 Tableerror in migrating laravel file to xampp serverSyntax error or access violation: 1064:syntax to use near 'unsigned not null, modelName varchar(191) not null, title varchar(191) not nLaravel cannot create new table field in mysqlLaravel 5.7:Last migration creates table but is not registered in the migration table

          은진 송씨 목차 역사 본관 분파 인물 조선 왕실과의 인척 관계 집성촌 항렬자 인구 같이 보기 각주 둘러보기 메뉴은진 송씨세종실록 149권, 지리지 충청도 공주목 은진현