Mistakenly modified `/bin/sh'What is the difference between #!/bin/sh and #!/bin/bash?Why do I have to change...

does ability to impeach an expert witness on science or scholarship go too far?

To accent or not to accent in Greek

What is the commentary on Leviticus 21:2-4 - why is wife not included on the list

CPU overheating in Ubuntu 18.04

When is pointing out a person's hypocrisy not considered to be a logical fallacy?

Why does java.time.Period#normalized() not normalize days?

Can I intentionally omit previous work experience or pretend it doesn't exist when applying for jobs?

Why is dry soil hydrophobic? Bad gardener paradox

Hacker Rank : Electronics Shop

nginx serves wrong domain site. It doenst shows default site if no configuration applies

Can I call 112 to check a police officer's identity in the Czech Republic?

Chaining Dissonant Whispers via War Caster feat

Should you avoid redundant information after dialogue?

Does Google Maps take into account hills/inclines for route times?

How do a planet's moons and a planet's rings interact?

Can a continent naturally split into two distant parts within a week?

What's the point of this scene involving Flash Thompson at the airport?

Was the Ford Model T black because of the speed black paint dries?

Cubic programming and beyond?

How to repair a laptop's screen hinges?

Pre-1968 YA science fiction novel: robot with black-and-white vision, later the robot could see in color

I quit, and boss offered me 3 month "grace period" where I could still come back

If the derivative of a function is square of it then it is constant

Is killing off one of my queer characters homophobic?



Mistakenly modified `/bin/sh'


What is the difference between #!/bin/sh and #!/bin/bash?Why do I have to change into my private bin folder to execute an .sh script?How to avoid /bin/sh -c /bin/bash and /bin/bash running for the same shell script?Change /bin/sh link temporarily






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







3















I had this script:



spd-say "Hello, don't forget the trash bin."


So it reminded me of what I supposed to do, and I moved it to /usr/local/bin/ and the command trash pronounced the argument,then I set a crontab job, to make it remind me everyday what I supposed to do. But the crontab didn't work and I couldn't understand why(It works well on other jobs).



Once I saw this message in my terminal:



You have new mail in /var/mail/root


at the end of which this line made me to do a bad mistake:



/bin/sh: 1: trash: not found


I know that it was a silly thing to do but I did:



mv /usr/local/bin/trash /bin/sh


thinking that sh is a directory and I should move the script there in order to be executed.



Now, when I want to see a man page the system says:




"Hello, don't forget the trash bin."




And the input of cat sh is:



#!/bin/bash
spd-say "Hello, don't forget the trash bin. "


Anyway, can I do anything or I have to reinstall my operating system?










share|improve this question































    3















    I had this script:



    spd-say "Hello, don't forget the trash bin."


    So it reminded me of what I supposed to do, and I moved it to /usr/local/bin/ and the command trash pronounced the argument,then I set a crontab job, to make it remind me everyday what I supposed to do. But the crontab didn't work and I couldn't understand why(It works well on other jobs).



    Once I saw this message in my terminal:



    You have new mail in /var/mail/root


    at the end of which this line made me to do a bad mistake:



    /bin/sh: 1: trash: not found


    I know that it was a silly thing to do but I did:



    mv /usr/local/bin/trash /bin/sh


    thinking that sh is a directory and I should move the script there in order to be executed.



    Now, when I want to see a man page the system says:




    "Hello, don't forget the trash bin."




    And the input of cat sh is:



    #!/bin/bash
    spd-say "Hello, don't forget the trash bin. "


    Anyway, can I do anything or I have to reinstall my operating system?










    share|improve this question



























      3












      3








      3








      I had this script:



      spd-say "Hello, don't forget the trash bin."


      So it reminded me of what I supposed to do, and I moved it to /usr/local/bin/ and the command trash pronounced the argument,then I set a crontab job, to make it remind me everyday what I supposed to do. But the crontab didn't work and I couldn't understand why(It works well on other jobs).



      Once I saw this message in my terminal:



      You have new mail in /var/mail/root


      at the end of which this line made me to do a bad mistake:



      /bin/sh: 1: trash: not found


      I know that it was a silly thing to do but I did:



      mv /usr/local/bin/trash /bin/sh


      thinking that sh is a directory and I should move the script there in order to be executed.



      Now, when I want to see a man page the system says:




      "Hello, don't forget the trash bin."




      And the input of cat sh is:



      #!/bin/bash
      spd-say "Hello, don't forget the trash bin. "


      Anyway, can I do anything or I have to reinstall my operating system?










      share|improve this question
















      I had this script:



      spd-say "Hello, don't forget the trash bin."


      So it reminded me of what I supposed to do, and I moved it to /usr/local/bin/ and the command trash pronounced the argument,then I set a crontab job, to make it remind me everyday what I supposed to do. But the crontab didn't work and I couldn't understand why(It works well on other jobs).



      Once I saw this message in my terminal:



      You have new mail in /var/mail/root


      at the end of which this line made me to do a bad mistake:



      /bin/sh: 1: trash: not found


      I know that it was a silly thing to do but I did:



      mv /usr/local/bin/trash /bin/sh


      thinking that sh is a directory and I should move the script there in order to be executed.



      Now, when I want to see a man page the system says:




      "Hello, don't forget the trash bin."




      And the input of cat sh is:



      #!/bin/bash
      spd-say "Hello, don't forget the trash bin. "


      Anyway, can I do anything or I have to reinstall my operating system?







      sh






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited 8 hours ago







      Codito ergo sum

















      asked 10 hours ago









      Codito ergo sumCodito ergo sum

      1,6466 gold badges11 silver badges27 bronze badges




      1,6466 gold badges11 silver badges27 bronze badges






















          2 Answers
          2






          active

          oldest

          votes


















          5














          In Ubuntu systems, /bin/sh is a symbolic link to the dash shell by default:



          $ ls -l /bin/sh
          lrwxrwxrwx 1 root root 4 Jul 7 2018 /bin/sh -> dash


          So (assuming your terminal emulator uses the bash shell, and didn't get broken by your mistake) all you need to do is re-create the link:



          sudo ln -sf dash /bin/sh





          share|improve this answer































            2














            No, you don't have to reinstall your system. /bin /sh is only a softlink to your shell. readlink -f /bin/sh
            /bin/bash
            In my case bash. Move your skript and make a Softlink to your favor shell.






            share|improve this answer


























              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%2f1158083%2fmistakenly-modified-bin-sh%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









              5














              In Ubuntu systems, /bin/sh is a symbolic link to the dash shell by default:



              $ ls -l /bin/sh
              lrwxrwxrwx 1 root root 4 Jul 7 2018 /bin/sh -> dash


              So (assuming your terminal emulator uses the bash shell, and didn't get broken by your mistake) all you need to do is re-create the link:



              sudo ln -sf dash /bin/sh





              share|improve this answer




























                5














                In Ubuntu systems, /bin/sh is a symbolic link to the dash shell by default:



                $ ls -l /bin/sh
                lrwxrwxrwx 1 root root 4 Jul 7 2018 /bin/sh -> dash


                So (assuming your terminal emulator uses the bash shell, and didn't get broken by your mistake) all you need to do is re-create the link:



                sudo ln -sf dash /bin/sh





                share|improve this answer


























                  5












                  5








                  5







                  In Ubuntu systems, /bin/sh is a symbolic link to the dash shell by default:



                  $ ls -l /bin/sh
                  lrwxrwxrwx 1 root root 4 Jul 7 2018 /bin/sh -> dash


                  So (assuming your terminal emulator uses the bash shell, and didn't get broken by your mistake) all you need to do is re-create the link:



                  sudo ln -sf dash /bin/sh





                  share|improve this answer













                  In Ubuntu systems, /bin/sh is a symbolic link to the dash shell by default:



                  $ ls -l /bin/sh
                  lrwxrwxrwx 1 root root 4 Jul 7 2018 /bin/sh -> dash


                  So (assuming your terminal emulator uses the bash shell, and didn't get broken by your mistake) all you need to do is re-create the link:



                  sudo ln -sf dash /bin/sh






                  share|improve this answer












                  share|improve this answer



                  share|improve this answer










                  answered 10 hours ago









                  steeldriversteeldriver

                  75.3k11 gold badges124 silver badges202 bronze badges




                  75.3k11 gold badges124 silver badges202 bronze badges

























                      2














                      No, you don't have to reinstall your system. /bin /sh is only a softlink to your shell. readlink -f /bin/sh
                      /bin/bash
                      In my case bash. Move your skript and make a Softlink to your favor shell.






                      share|improve this answer




























                        2














                        No, you don't have to reinstall your system. /bin /sh is only a softlink to your shell. readlink -f /bin/sh
                        /bin/bash
                        In my case bash. Move your skript and make a Softlink to your favor shell.






                        share|improve this answer


























                          2












                          2








                          2







                          No, you don't have to reinstall your system. /bin /sh is only a softlink to your shell. readlink -f /bin/sh
                          /bin/bash
                          In my case bash. Move your skript and make a Softlink to your favor shell.






                          share|improve this answer













                          No, you don't have to reinstall your system. /bin /sh is only a softlink to your shell. readlink -f /bin/sh
                          /bin/bash
                          In my case bash. Move your skript and make a Softlink to your favor shell.







                          share|improve this answer












                          share|improve this answer



                          share|improve this answer










                          answered 10 hours ago









                          nobodynobody

                          4948 bronze badges




                          4948 bronze badges






























                              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%2f1158083%2fmistakenly-modified-bin-sh%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

                              Taj Mahal Inhaltsverzeichnis Aufbau | Geschichte | 350-Jahr-Feier | Heutige Bedeutung | Siehe auch |...

                              Baia Sprie Cuprins Etimologie | Istorie | Demografie | Politică și administrație | Arii naturale...

                              Nicolae Petrescu-Găină Cuprins Biografie | Opera | In memoriam | Varia | Controverse, incertitudini...