Execute a statement /bin/bash seems not to work in Virtualbox clientExecute script in sh mode instead of bash...

Why "Having chlorophyll without photosynthesis is actually very dangerous" and "like living with a bomb"?

Important Resources for Dark Age Civilizations?

Can I ask the recruiters in my resume to put the reason why I am rejected?

What's that red-plus icon near a text?

What is the word for reserving something for yourself before others do?

What does it mean to describe someone as a butt steak?

Modeling an IP Address

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

Can you really stack all of this on an Opportunity Attack?

Watching something be written to a file live with tail

Was any UN Security Council vote triple-vetoed?

I'm flying to France today and my passport expires in less than 2 months

Alternative to sending password over mail?

Paid for article while in US on F-1 visa?

Can an x86 CPU running in real mode be considered to be basically an 8086 CPU?

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

Malformed Address '10.10.21.08/24', must be X.X.X.X/NN or

Is it tax fraud for an individual to declare non-taxable revenue as taxable income? (US tax laws)

Why do I get two different answers for this counting problem?

Why is Minecraft giving an OpenGL error?

Can a Cauchy sequence converge for one metric while not converging for another?

How can bays and straits be determined in a procedurally generated map?

What would happen to a modern skyscraper if it rains micro blackholes?

What defenses are there against being summoned by the Gate spell?



Execute a statement /bin/bash seems not to work in Virtualbox client


Execute script in sh mode instead of bash in ShellWhy does /bin/sh point to /bin/dash and not /bin/bash?Change Gsetting with script on LogoutNot able to execute a .sh file: /bin/bash^M: bad interpretermysql statement in bash shell script does not work / syntax errorunable to execute after loading second shell /bin/bash?Multiple comparison statement in bash fails - bash: [: missing `]'/bin/bash How to interact with python virtualenv?exec command bin bashbash - return and print statementBash: 'if' statement always seems to evaluate first condition as true even when false






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







1















I do not know if AskUbuntu is the correct place to ask or Stack Overflow.



To execute a statement in Windows use : C:\Windows\System32\cmd.exe What is the equivalent in Ubuntu? I thought it was : /bin/bash but that does not work for me. I tried /bin/sh and /bin/dash ( like shown here )but without result.



In Virtualbox client I want to be able to execute a statement. For this I use pyvbox which is a Python shell for the virtualbox API.



After installing execute in statement in Virtualbox Windows client is possible with the statement :



process, stdout, stderr = gs.execute('C:\Windows\System32\cmd.exe', ['/C', 'tasklist'])


See this link



I want to something like this for VBox Ubuntu client with the statement :



process, stdout, stderr = gs.execute('/bin/bash',['echo hello world'])


which returns no output.



In VBox Ubuntu client statement :



which bash


returns :



/bin/bash


And echo hello world is executed well.



Which alternatives there might be to execute a statement in Ubuntu? Sorry if this is not the correct place to ask.










share|improve this question































    1















    I do not know if AskUbuntu is the correct place to ask or Stack Overflow.



    To execute a statement in Windows use : C:\Windows\System32\cmd.exe What is the equivalent in Ubuntu? I thought it was : /bin/bash but that does not work for me. I tried /bin/sh and /bin/dash ( like shown here )but without result.



    In Virtualbox client I want to be able to execute a statement. For this I use pyvbox which is a Python shell for the virtualbox API.



    After installing execute in statement in Virtualbox Windows client is possible with the statement :



    process, stdout, stderr = gs.execute('C:\Windows\System32\cmd.exe', ['/C', 'tasklist'])


    See this link



    I want to something like this for VBox Ubuntu client with the statement :



    process, stdout, stderr = gs.execute('/bin/bash',['echo hello world'])


    which returns no output.



    In VBox Ubuntu client statement :



    which bash


    returns :



    /bin/bash


    And echo hello world is executed well.



    Which alternatives there might be to execute a statement in Ubuntu? Sorry if this is not the correct place to ask.










    share|improve this question



























      1












      1








      1








      I do not know if AskUbuntu is the correct place to ask or Stack Overflow.



      To execute a statement in Windows use : C:\Windows\System32\cmd.exe What is the equivalent in Ubuntu? I thought it was : /bin/bash but that does not work for me. I tried /bin/sh and /bin/dash ( like shown here )but without result.



      In Virtualbox client I want to be able to execute a statement. For this I use pyvbox which is a Python shell for the virtualbox API.



      After installing execute in statement in Virtualbox Windows client is possible with the statement :



      process, stdout, stderr = gs.execute('C:\Windows\System32\cmd.exe', ['/C', 'tasklist'])


      See this link



      I want to something like this for VBox Ubuntu client with the statement :



      process, stdout, stderr = gs.execute('/bin/bash',['echo hello world'])


      which returns no output.



      In VBox Ubuntu client statement :



      which bash


      returns :



      /bin/bash


      And echo hello world is executed well.



      Which alternatives there might be to execute a statement in Ubuntu? Sorry if this is not the correct place to ask.










      share|improve this question
















      I do not know if AskUbuntu is the correct place to ask or Stack Overflow.



      To execute a statement in Windows use : C:\Windows\System32\cmd.exe What is the equivalent in Ubuntu? I thought it was : /bin/bash but that does not work for me. I tried /bin/sh and /bin/dash ( like shown here )but without result.



      In Virtualbox client I want to be able to execute a statement. For this I use pyvbox which is a Python shell for the virtualbox API.



      After installing execute in statement in Virtualbox Windows client is possible with the statement :



      process, stdout, stderr = gs.execute('C:\Windows\System32\cmd.exe', ['/C', 'tasklist'])


      See this link



      I want to something like this for VBox Ubuntu client with the statement :



      process, stdout, stderr = gs.execute('/bin/bash',['echo hello world'])


      which returns no output.



      In VBox Ubuntu client statement :



      which bash


      returns :



      /bin/bash


      And echo hello world is executed well.



      Which alternatives there might be to execute a statement in Ubuntu? Sorry if this is not the correct place to ask.







      command-line bash virtualbox python






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited May 23 '17 at 12:39









      Community

      1




      1










      asked Jul 11 '14 at 12:51









      BernardBernard

      2222313




      2222313






















          2 Answers
          2






          active

          oldest

          votes


















          1














          man bash



          ... i.e. try to adapt your code to bash -c 'echo Hello!'



          Need to know more about bash?



          http://tldp.org has at least two guides om bash - they will take you from a novice to an advanced level.






          share|improve this answer


























          • Thanks. I tried which raised an exception : 'Specified file was not found on guest'

            – Bernard
            Jul 11 '14 at 13:08











          • I interpret that as a problem caused by pyvbox - try process, stdout, stderr = gs.execute('/bin/bash',['-c echo hello world']) or something similar, I suspect the first arg must be kept as is. The bare bash -c call above works. Try it out.

            – Hannu
            Jul 11 '14 at 13:12













          • @Hanna. Very warm. Your suggestion did not work. But process, stdout, stderr = gs.execute('/bin/bash',['-c', 'echo hello world']) did. Thanks very much.

            – Bernard
            Jul 11 '14 at 13:18





















          0














          Can you tell me the last to solve this problem? Recently, I also encountered the need to operate virtual machines on physical machines. My virtual machines are all centos systems.






          share|improve this answer








          New contributor




          lo_ongc 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: "89"
            };
            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%2faskubuntu.com%2fquestions%2f496451%2fexecute-a-statement-bin-bash-seems-not-to-work-in-virtualbox-client%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









            1














            man bash



            ... i.e. try to adapt your code to bash -c 'echo Hello!'



            Need to know more about bash?



            http://tldp.org has at least two guides om bash - they will take you from a novice to an advanced level.






            share|improve this answer


























            • Thanks. I tried which raised an exception : 'Specified file was not found on guest'

              – Bernard
              Jul 11 '14 at 13:08











            • I interpret that as a problem caused by pyvbox - try process, stdout, stderr = gs.execute('/bin/bash',['-c echo hello world']) or something similar, I suspect the first arg must be kept as is. The bare bash -c call above works. Try it out.

              – Hannu
              Jul 11 '14 at 13:12













            • @Hanna. Very warm. Your suggestion did not work. But process, stdout, stderr = gs.execute('/bin/bash',['-c', 'echo hello world']) did. Thanks very much.

              – Bernard
              Jul 11 '14 at 13:18


















            1














            man bash



            ... i.e. try to adapt your code to bash -c 'echo Hello!'



            Need to know more about bash?



            http://tldp.org has at least two guides om bash - they will take you from a novice to an advanced level.






            share|improve this answer


























            • Thanks. I tried which raised an exception : 'Specified file was not found on guest'

              – Bernard
              Jul 11 '14 at 13:08











            • I interpret that as a problem caused by pyvbox - try process, stdout, stderr = gs.execute('/bin/bash',['-c echo hello world']) or something similar, I suspect the first arg must be kept as is. The bare bash -c call above works. Try it out.

              – Hannu
              Jul 11 '14 at 13:12













            • @Hanna. Very warm. Your suggestion did not work. But process, stdout, stderr = gs.execute('/bin/bash',['-c', 'echo hello world']) did. Thanks very much.

              – Bernard
              Jul 11 '14 at 13:18
















            1












            1








            1







            man bash



            ... i.e. try to adapt your code to bash -c 'echo Hello!'



            Need to know more about bash?



            http://tldp.org has at least two guides om bash - they will take you from a novice to an advanced level.






            share|improve this answer















            man bash



            ... i.e. try to adapt your code to bash -c 'echo Hello!'



            Need to know more about bash?



            http://tldp.org has at least two guides om bash - they will take you from a novice to an advanced level.







            share|improve this answer














            share|improve this answer



            share|improve this answer








            edited Jul 13 '14 at 14:09

























            answered Jul 11 '14 at 13:05









            HannuHannu

            2,2581227




            2,2581227













            • Thanks. I tried which raised an exception : 'Specified file was not found on guest'

              – Bernard
              Jul 11 '14 at 13:08











            • I interpret that as a problem caused by pyvbox - try process, stdout, stderr = gs.execute('/bin/bash',['-c echo hello world']) or something similar, I suspect the first arg must be kept as is. The bare bash -c call above works. Try it out.

              – Hannu
              Jul 11 '14 at 13:12













            • @Hanna. Very warm. Your suggestion did not work. But process, stdout, stderr = gs.execute('/bin/bash',['-c', 'echo hello world']) did. Thanks very much.

              – Bernard
              Jul 11 '14 at 13:18





















            • Thanks. I tried which raised an exception : 'Specified file was not found on guest'

              – Bernard
              Jul 11 '14 at 13:08











            • I interpret that as a problem caused by pyvbox - try process, stdout, stderr = gs.execute('/bin/bash',['-c echo hello world']) or something similar, I suspect the first arg must be kept as is. The bare bash -c call above works. Try it out.

              – Hannu
              Jul 11 '14 at 13:12













            • @Hanna. Very warm. Your suggestion did not work. But process, stdout, stderr = gs.execute('/bin/bash',['-c', 'echo hello world']) did. Thanks very much.

              – Bernard
              Jul 11 '14 at 13:18



















            Thanks. I tried which raised an exception : 'Specified file was not found on guest'

            – Bernard
            Jul 11 '14 at 13:08





            Thanks. I tried which raised an exception : 'Specified file was not found on guest'

            – Bernard
            Jul 11 '14 at 13:08













            I interpret that as a problem caused by pyvbox - try process, stdout, stderr = gs.execute('/bin/bash',['-c echo hello world']) or something similar, I suspect the first arg must be kept as is. The bare bash -c call above works. Try it out.

            – Hannu
            Jul 11 '14 at 13:12







            I interpret that as a problem caused by pyvbox - try process, stdout, stderr = gs.execute('/bin/bash',['-c echo hello world']) or something similar, I suspect the first arg must be kept as is. The bare bash -c call above works. Try it out.

            – Hannu
            Jul 11 '14 at 13:12















            @Hanna. Very warm. Your suggestion did not work. But process, stdout, stderr = gs.execute('/bin/bash',['-c', 'echo hello world']) did. Thanks very much.

            – Bernard
            Jul 11 '14 at 13:18







            @Hanna. Very warm. Your suggestion did not work. But process, stdout, stderr = gs.execute('/bin/bash',['-c', 'echo hello world']) did. Thanks very much.

            – Bernard
            Jul 11 '14 at 13:18















            0














            Can you tell me the last to solve this problem? Recently, I also encountered the need to operate virtual machines on physical machines. My virtual machines are all centos systems.






            share|improve this answer








            New contributor




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

























              0














              Can you tell me the last to solve this problem? Recently, I also encountered the need to operate virtual machines on physical machines. My virtual machines are all centos systems.






              share|improve this answer








              New contributor




              lo_ongc 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







                Can you tell me the last to solve this problem? Recently, I also encountered the need to operate virtual machines on physical machines. My virtual machines are all centos systems.






                share|improve this answer








                New contributor




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










                Can you tell me the last to solve this problem? Recently, I also encountered the need to operate virtual machines on physical machines. My virtual machines are all centos systems.







                share|improve this answer








                New contributor




                lo_ongc 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




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









                answered 32 mins ago









                lo_ongclo_ongc

                1




                1




                New contributor




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





                New contributor





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






                lo_ongc 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 Ask Ubuntu!


                    • 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%2faskubuntu.com%2fquestions%2f496451%2fexecute-a-statement-bin-bash-seems-not-to-work-in-virtualbox-client%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

                    Why do type traits not work with types in namespace scope?What are POD types in C++?Why can templates only be...

                    Will tsunami waves travel forever if there was no land?Why do tsunami waves begin with the water flowing away...

                    Should I use Docker or LXD?How to cache (more) data on SSD/RAM to avoid spin up?Unable to get Windows File...