Error in Makefile, Cannot Set Shell to /bin/bash (WSL)












0















I'm running make version 4.1 Built for x86_64-pc-linux-gnu on WSL Ubuntu. I have the following makefile and I'm trying to run make with it. However it fails when I run it with the error message:



make: /bin/bash : Command not found
makefile:18: recipe for target 'cc' failed
make: *** [cc] Error 127


I checked the /bin/ folder and bash does exists so I have no idea why this isn't working. Could anyone enlighten me?










share|improve this question





























    0















    I'm running make version 4.1 Built for x86_64-pc-linux-gnu on WSL Ubuntu. I have the following makefile and I'm trying to run make with it. However it fails when I run it with the error message:



    make: /bin/bash : Command not found
    makefile:18: recipe for target 'cc' failed
    make: *** [cc] Error 127


    I checked the /bin/ folder and bash does exists so I have no idea why this isn't working. Could anyone enlighten me?










    share|improve this question



























      0












      0








      0








      I'm running make version 4.1 Built for x86_64-pc-linux-gnu on WSL Ubuntu. I have the following makefile and I'm trying to run make with it. However it fails when I run it with the error message:



      make: /bin/bash : Command not found
      makefile:18: recipe for target 'cc' failed
      make: *** [cc] Error 127


      I checked the /bin/ folder and bash does exists so I have no idea why this isn't working. Could anyone enlighten me?










      share|improve this question
















      I'm running make version 4.1 Built for x86_64-pc-linux-gnu on WSL Ubuntu. I have the following makefile and I'm trying to run make with it. However it fails when I run it with the error message:



      make: /bin/bash : Command not found
      makefile:18: recipe for target 'cc' failed
      make: *** [cc] Error 127


      I checked the /bin/ folder and bash does exists so I have no idea why this isn't working. Could anyone enlighten me?







      make windows-subsystem-for-linux






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Dec 31 '18 at 16:32









      Kulfy

      4,19651341




      4,19651341










      asked Dec 31 '18 at 16:12









      Mohsin KaleMohsin Kale

      1




      1






















          1 Answer
          1






          active

          oldest

          votes


















          1














          GNU make is parsing the trailing whitespace after the SHELL := /bin/bash as part of the executable name. As noted in GNU make: How to Use Variables




          You can also use them to introduce controlled leading whitespace into
          variable values. Leading whitespace characters are discarded from your
          input before substitution of variable references and function calls;
          this means you can include leading spaces in a variable value by
          protecting them with variable references, like this:



          nullstring :=
          space := $(nullstring) # end of the line


          Here the value of the variable space is precisely one space. The
          comment `# end of the line' is included here just for clarity. Since
          trailing space characters are not stripped from variable values, just
          a space at the end of the line would have the same effect (but be
          rather hard to read). If you put whitespace at the end of a variable
          value, it is a good idea to put a comment like that at the end of the
          line to make your intent clear. Conversely, if you do not want any
          whitespace characters at the end of your variable value, you must
          remember not to put a random comment on the end of the line after some
          whitespace, such as this:



          dir := /foo/bar    # directory to put the frobs in


          Here the value of the variable dir is /foo/bar (with four trailing
          spaces), which was probably not the intention. (Imagine something like
          $(dir)/file with this definition!)







          share|improve this answer
























          • My god, Your a life saver. I thought there might be something wrong with my install. I knew about the whitespace feature but I thought it would auto truncate for executables like the shell. Didn't even occur to me that thats where the problem is. Thank you, this fixed it.

            – Mohsin Kale
            Dec 31 '18 at 17:01











          • @MohsinKale you're welcome - TBH at first I thought it must be something WSL specific - only started digging after I tested it on native Ubuntu and got the same behavior

            – steeldriver
            Dec 31 '18 at 17:03











          • I agree, in my defence it doesn't help that in the error message the space is truncated but in the actual make interpreter it isn't

            – Mohsin Kale
            Dec 31 '18 at 17:17











          • @MohsinKale if you look carefully you will notice it says make: /bin/bash : Command not found not make: /bin/bash: Command not found ;)

            – steeldriver
            Dec 31 '18 at 17:28











          • Damn, You're Right. It just looked so natural.

            – Mohsin Kale
            Dec 31 '18 at 18:01











          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%2f1105868%2ferror-in-makefile-cannot-set-shell-to-bin-bash-wsl%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









          1














          GNU make is parsing the trailing whitespace after the SHELL := /bin/bash as part of the executable name. As noted in GNU make: How to Use Variables




          You can also use them to introduce controlled leading whitespace into
          variable values. Leading whitespace characters are discarded from your
          input before substitution of variable references and function calls;
          this means you can include leading spaces in a variable value by
          protecting them with variable references, like this:



          nullstring :=
          space := $(nullstring) # end of the line


          Here the value of the variable space is precisely one space. The
          comment `# end of the line' is included here just for clarity. Since
          trailing space characters are not stripped from variable values, just
          a space at the end of the line would have the same effect (but be
          rather hard to read). If you put whitespace at the end of a variable
          value, it is a good idea to put a comment like that at the end of the
          line to make your intent clear. Conversely, if you do not want any
          whitespace characters at the end of your variable value, you must
          remember not to put a random comment on the end of the line after some
          whitespace, such as this:



          dir := /foo/bar    # directory to put the frobs in


          Here the value of the variable dir is /foo/bar (with four trailing
          spaces), which was probably not the intention. (Imagine something like
          $(dir)/file with this definition!)







          share|improve this answer
























          • My god, Your a life saver. I thought there might be something wrong with my install. I knew about the whitespace feature but I thought it would auto truncate for executables like the shell. Didn't even occur to me that thats where the problem is. Thank you, this fixed it.

            – Mohsin Kale
            Dec 31 '18 at 17:01











          • @MohsinKale you're welcome - TBH at first I thought it must be something WSL specific - only started digging after I tested it on native Ubuntu and got the same behavior

            – steeldriver
            Dec 31 '18 at 17:03











          • I agree, in my defence it doesn't help that in the error message the space is truncated but in the actual make interpreter it isn't

            – Mohsin Kale
            Dec 31 '18 at 17:17











          • @MohsinKale if you look carefully you will notice it says make: /bin/bash : Command not found not make: /bin/bash: Command not found ;)

            – steeldriver
            Dec 31 '18 at 17:28











          • Damn, You're Right. It just looked so natural.

            – Mohsin Kale
            Dec 31 '18 at 18:01
















          1














          GNU make is parsing the trailing whitespace after the SHELL := /bin/bash as part of the executable name. As noted in GNU make: How to Use Variables




          You can also use them to introduce controlled leading whitespace into
          variable values. Leading whitespace characters are discarded from your
          input before substitution of variable references and function calls;
          this means you can include leading spaces in a variable value by
          protecting them with variable references, like this:



          nullstring :=
          space := $(nullstring) # end of the line


          Here the value of the variable space is precisely one space. The
          comment `# end of the line' is included here just for clarity. Since
          trailing space characters are not stripped from variable values, just
          a space at the end of the line would have the same effect (but be
          rather hard to read). If you put whitespace at the end of a variable
          value, it is a good idea to put a comment like that at the end of the
          line to make your intent clear. Conversely, if you do not want any
          whitespace characters at the end of your variable value, you must
          remember not to put a random comment on the end of the line after some
          whitespace, such as this:



          dir := /foo/bar    # directory to put the frobs in


          Here the value of the variable dir is /foo/bar (with four trailing
          spaces), which was probably not the intention. (Imagine something like
          $(dir)/file with this definition!)







          share|improve this answer
























          • My god, Your a life saver. I thought there might be something wrong with my install. I knew about the whitespace feature but I thought it would auto truncate for executables like the shell. Didn't even occur to me that thats where the problem is. Thank you, this fixed it.

            – Mohsin Kale
            Dec 31 '18 at 17:01











          • @MohsinKale you're welcome - TBH at first I thought it must be something WSL specific - only started digging after I tested it on native Ubuntu and got the same behavior

            – steeldriver
            Dec 31 '18 at 17:03











          • I agree, in my defence it doesn't help that in the error message the space is truncated but in the actual make interpreter it isn't

            – Mohsin Kale
            Dec 31 '18 at 17:17











          • @MohsinKale if you look carefully you will notice it says make: /bin/bash : Command not found not make: /bin/bash: Command not found ;)

            – steeldriver
            Dec 31 '18 at 17:28











          • Damn, You're Right. It just looked so natural.

            – Mohsin Kale
            Dec 31 '18 at 18:01














          1












          1








          1







          GNU make is parsing the trailing whitespace after the SHELL := /bin/bash as part of the executable name. As noted in GNU make: How to Use Variables




          You can also use them to introduce controlled leading whitespace into
          variable values. Leading whitespace characters are discarded from your
          input before substitution of variable references and function calls;
          this means you can include leading spaces in a variable value by
          protecting them with variable references, like this:



          nullstring :=
          space := $(nullstring) # end of the line


          Here the value of the variable space is precisely one space. The
          comment `# end of the line' is included here just for clarity. Since
          trailing space characters are not stripped from variable values, just
          a space at the end of the line would have the same effect (but be
          rather hard to read). If you put whitespace at the end of a variable
          value, it is a good idea to put a comment like that at the end of the
          line to make your intent clear. Conversely, if you do not want any
          whitespace characters at the end of your variable value, you must
          remember not to put a random comment on the end of the line after some
          whitespace, such as this:



          dir := /foo/bar    # directory to put the frobs in


          Here the value of the variable dir is /foo/bar (with four trailing
          spaces), which was probably not the intention. (Imagine something like
          $(dir)/file with this definition!)







          share|improve this answer













          GNU make is parsing the trailing whitespace after the SHELL := /bin/bash as part of the executable name. As noted in GNU make: How to Use Variables




          You can also use them to introduce controlled leading whitespace into
          variable values. Leading whitespace characters are discarded from your
          input before substitution of variable references and function calls;
          this means you can include leading spaces in a variable value by
          protecting them with variable references, like this:



          nullstring :=
          space := $(nullstring) # end of the line


          Here the value of the variable space is precisely one space. The
          comment `# end of the line' is included here just for clarity. Since
          trailing space characters are not stripped from variable values, just
          a space at the end of the line would have the same effect (but be
          rather hard to read). If you put whitespace at the end of a variable
          value, it is a good idea to put a comment like that at the end of the
          line to make your intent clear. Conversely, if you do not want any
          whitespace characters at the end of your variable value, you must
          remember not to put a random comment on the end of the line after some
          whitespace, such as this:



          dir := /foo/bar    # directory to put the frobs in


          Here the value of the variable dir is /foo/bar (with four trailing
          spaces), which was probably not the intention. (Imagine something like
          $(dir)/file with this definition!)








          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered Dec 31 '18 at 16:58









          steeldriversteeldriver

          66.4k11107179




          66.4k11107179













          • My god, Your a life saver. I thought there might be something wrong with my install. I knew about the whitespace feature but I thought it would auto truncate for executables like the shell. Didn't even occur to me that thats where the problem is. Thank you, this fixed it.

            – Mohsin Kale
            Dec 31 '18 at 17:01











          • @MohsinKale you're welcome - TBH at first I thought it must be something WSL specific - only started digging after I tested it on native Ubuntu and got the same behavior

            – steeldriver
            Dec 31 '18 at 17:03











          • I agree, in my defence it doesn't help that in the error message the space is truncated but in the actual make interpreter it isn't

            – Mohsin Kale
            Dec 31 '18 at 17:17











          • @MohsinKale if you look carefully you will notice it says make: /bin/bash : Command not found not make: /bin/bash: Command not found ;)

            – steeldriver
            Dec 31 '18 at 17:28











          • Damn, You're Right. It just looked so natural.

            – Mohsin Kale
            Dec 31 '18 at 18:01



















          • My god, Your a life saver. I thought there might be something wrong with my install. I knew about the whitespace feature but I thought it would auto truncate for executables like the shell. Didn't even occur to me that thats where the problem is. Thank you, this fixed it.

            – Mohsin Kale
            Dec 31 '18 at 17:01











          • @MohsinKale you're welcome - TBH at first I thought it must be something WSL specific - only started digging after I tested it on native Ubuntu and got the same behavior

            – steeldriver
            Dec 31 '18 at 17:03











          • I agree, in my defence it doesn't help that in the error message the space is truncated but in the actual make interpreter it isn't

            – Mohsin Kale
            Dec 31 '18 at 17:17











          • @MohsinKale if you look carefully you will notice it says make: /bin/bash : Command not found not make: /bin/bash: Command not found ;)

            – steeldriver
            Dec 31 '18 at 17:28











          • Damn, You're Right. It just looked so natural.

            – Mohsin Kale
            Dec 31 '18 at 18:01

















          My god, Your a life saver. I thought there might be something wrong with my install. I knew about the whitespace feature but I thought it would auto truncate for executables like the shell. Didn't even occur to me that thats where the problem is. Thank you, this fixed it.

          – Mohsin Kale
          Dec 31 '18 at 17:01





          My god, Your a life saver. I thought there might be something wrong with my install. I knew about the whitespace feature but I thought it would auto truncate for executables like the shell. Didn't even occur to me that thats where the problem is. Thank you, this fixed it.

          – Mohsin Kale
          Dec 31 '18 at 17:01













          @MohsinKale you're welcome - TBH at first I thought it must be something WSL specific - only started digging after I tested it on native Ubuntu and got the same behavior

          – steeldriver
          Dec 31 '18 at 17:03





          @MohsinKale you're welcome - TBH at first I thought it must be something WSL specific - only started digging after I tested it on native Ubuntu and got the same behavior

          – steeldriver
          Dec 31 '18 at 17:03













          I agree, in my defence it doesn't help that in the error message the space is truncated but in the actual make interpreter it isn't

          – Mohsin Kale
          Dec 31 '18 at 17:17





          I agree, in my defence it doesn't help that in the error message the space is truncated but in the actual make interpreter it isn't

          – Mohsin Kale
          Dec 31 '18 at 17:17













          @MohsinKale if you look carefully you will notice it says make: /bin/bash : Command not found not make: /bin/bash: Command not found ;)

          – steeldriver
          Dec 31 '18 at 17:28





          @MohsinKale if you look carefully you will notice it says make: /bin/bash : Command not found not make: /bin/bash: Command not found ;)

          – steeldriver
          Dec 31 '18 at 17:28













          Damn, You're Right. It just looked so natural.

          – Mohsin Kale
          Dec 31 '18 at 18:01





          Damn, You're Right. It just looked so natural.

          – Mohsin Kale
          Dec 31 '18 at 18:01


















          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%2f1105868%2ferror-in-makefile-cannot-set-shell-to-bin-bash-wsl%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

          Quarter-circle Tiles

          build a pushdown automaton that recognizes the reverse language of a given pushdown automaton?

          Mont Emei