Why is my alias now not working?

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP








up vote
2
down vote

favorite












So before I reformatted (to get rid of Windows), I simply used this command to open documents by putting it at the end of the ~/.bashrc file:



alias commandless= 'gnome-open ./Documents/the-linux-command-line.pdf; gnome-open ./Documents/linux.odt'


But now everytime I start the terminal, it says:



bash: alias: gnome-open ./Documents/the-linux-command-line.pdf; gnome-open ./Documents/linux.odt: not found


before even typing anything in, and when I run the command nothing happens, not even error messages.







share|improve this question


























    up vote
    2
    down vote

    favorite












    So before I reformatted (to get rid of Windows), I simply used this command to open documents by putting it at the end of the ~/.bashrc file:



    alias commandless= 'gnome-open ./Documents/the-linux-command-line.pdf; gnome-open ./Documents/linux.odt'


    But now everytime I start the terminal, it says:



    bash: alias: gnome-open ./Documents/the-linux-command-line.pdf; gnome-open ./Documents/linux.odt: not found


    before even typing anything in, and when I run the command nothing happens, not even error messages.







    share|improve this question
























      up vote
      2
      down vote

      favorite









      up vote
      2
      down vote

      favorite











      So before I reformatted (to get rid of Windows), I simply used this command to open documents by putting it at the end of the ~/.bashrc file:



      alias commandless= 'gnome-open ./Documents/the-linux-command-line.pdf; gnome-open ./Documents/linux.odt'


      But now everytime I start the terminal, it says:



      bash: alias: gnome-open ./Documents/the-linux-command-line.pdf; gnome-open ./Documents/linux.odt: not found


      before even typing anything in, and when I run the command nothing happens, not even error messages.







      share|improve this question














      So before I reformatted (to get rid of Windows), I simply used this command to open documents by putting it at the end of the ~/.bashrc file:



      alias commandless= 'gnome-open ./Documents/the-linux-command-line.pdf; gnome-open ./Documents/linux.odt'


      But now everytime I start the terminal, it says:



      bash: alias: gnome-open ./Documents/the-linux-command-line.pdf; gnome-open ./Documents/linux.odt: not found


      before even typing anything in, and when I run the command nothing happens, not even error messages.









      share|improve this question













      share|improve this question




      share|improve this question








      edited Oct 12 '15 at 15:38









      kos

      24.5k867115




      24.5k867115










      asked Oct 12 '15 at 15:17









      thinksinbinary

      3741615




      3741615




















          2 Answers
          2






          active

          oldest

          votes

















          up vote
          1
          down vote



          accepted










          Use double quotes instead of single quotes:



          alias newcommand="full path of the binary to be executed"


          and not:



          alias newcommand='full path of the binary to be executed'


          No space near equal either on the left or on the right.






          share|improve this answer


















          • 6




            Using double-quotes doesn't change anything in this case, the problem is the space after the =
            – kos
            Oct 12 '15 at 16:35










          • There should not be any space between equal to
            – AVS
            Oct 12 '15 at 16:39










          • no, ABISHEK appears to be right, i had to remove the space and put in the quotes instead of the apostrophe
            – thinksinbinary
            Oct 12 '15 at 16:45










          • That I'm afraid still doesn't make the "use double-quotes" suggestion right. If you want to remove it, since it's wrong and misleading, I'll remove my downvote, however there's another answer pointing out the space problem which was posted 45 minutes before yours, so your answer is (aside from the single / double quotes thing) basically identical to the answer already present. It doesn't really add anything new.
            – kos
            Oct 12 '15 at 16:48







          • 3




            @thinksinbinary Double-quotes are definetly not necessary. Try using single quotes instead, it will still work regardless.
            – kos
            Oct 12 '15 at 16:50

















          up vote
          20
          down vote













          You have a space between the = and the opening '. Remove it.



          $ alias foo= 'bar baz'
          bash: alias: bar baz: not found





          share|improve this answer


















          • 1




            Especially with bash -- it parses the commands into tokens by whitespace, so it's extremely sensitive to stray spaces.
            – glenn jackman
            Oct 12 '15 at 16:49










          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',
          convertImagesToLinks: true,
          noModals: false,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: 10,
          bindNavPrevention: true,
          postfix: "",
          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%2f684635%2fwhy-is-my-alias-now-not-working%23new-answer', 'question_page');

          );

          Post as a guest






























          2 Answers
          2






          active

          oldest

          votes








          2 Answers
          2






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes








          up vote
          1
          down vote



          accepted










          Use double quotes instead of single quotes:



          alias newcommand="full path of the binary to be executed"


          and not:



          alias newcommand='full path of the binary to be executed'


          No space near equal either on the left or on the right.






          share|improve this answer


















          • 6




            Using double-quotes doesn't change anything in this case, the problem is the space after the =
            – kos
            Oct 12 '15 at 16:35










          • There should not be any space between equal to
            – AVS
            Oct 12 '15 at 16:39










          • no, ABISHEK appears to be right, i had to remove the space and put in the quotes instead of the apostrophe
            – thinksinbinary
            Oct 12 '15 at 16:45










          • That I'm afraid still doesn't make the "use double-quotes" suggestion right. If you want to remove it, since it's wrong and misleading, I'll remove my downvote, however there's another answer pointing out the space problem which was posted 45 minutes before yours, so your answer is (aside from the single / double quotes thing) basically identical to the answer already present. It doesn't really add anything new.
            – kos
            Oct 12 '15 at 16:48







          • 3




            @thinksinbinary Double-quotes are definetly not necessary. Try using single quotes instead, it will still work regardless.
            – kos
            Oct 12 '15 at 16:50














          up vote
          1
          down vote



          accepted










          Use double quotes instead of single quotes:



          alias newcommand="full path of the binary to be executed"


          and not:



          alias newcommand='full path of the binary to be executed'


          No space near equal either on the left or on the right.






          share|improve this answer


















          • 6




            Using double-quotes doesn't change anything in this case, the problem is the space after the =
            – kos
            Oct 12 '15 at 16:35










          • There should not be any space between equal to
            – AVS
            Oct 12 '15 at 16:39










          • no, ABISHEK appears to be right, i had to remove the space and put in the quotes instead of the apostrophe
            – thinksinbinary
            Oct 12 '15 at 16:45










          • That I'm afraid still doesn't make the "use double-quotes" suggestion right. If you want to remove it, since it's wrong and misleading, I'll remove my downvote, however there's another answer pointing out the space problem which was posted 45 minutes before yours, so your answer is (aside from the single / double quotes thing) basically identical to the answer already present. It doesn't really add anything new.
            – kos
            Oct 12 '15 at 16:48







          • 3




            @thinksinbinary Double-quotes are definetly not necessary. Try using single quotes instead, it will still work regardless.
            – kos
            Oct 12 '15 at 16:50












          up vote
          1
          down vote



          accepted







          up vote
          1
          down vote



          accepted






          Use double quotes instead of single quotes:



          alias newcommand="full path of the binary to be executed"


          and not:



          alias newcommand='full path of the binary to be executed'


          No space near equal either on the left or on the right.






          share|improve this answer














          Use double quotes instead of single quotes:



          alias newcommand="full path of the binary to be executed"


          and not:



          alias newcommand='full path of the binary to be executed'


          No space near equal either on the left or on the right.







          share|improve this answer














          share|improve this answer



          share|improve this answer








          edited Oct 12 '15 at 16:34









          kos

          24.5k867115




          24.5k867115










          answered Oct 12 '15 at 16:25









          AVS

          362




          362







          • 6




            Using double-quotes doesn't change anything in this case, the problem is the space after the =
            – kos
            Oct 12 '15 at 16:35










          • There should not be any space between equal to
            – AVS
            Oct 12 '15 at 16:39










          • no, ABISHEK appears to be right, i had to remove the space and put in the quotes instead of the apostrophe
            – thinksinbinary
            Oct 12 '15 at 16:45










          • That I'm afraid still doesn't make the "use double-quotes" suggestion right. If you want to remove it, since it's wrong and misleading, I'll remove my downvote, however there's another answer pointing out the space problem which was posted 45 minutes before yours, so your answer is (aside from the single / double quotes thing) basically identical to the answer already present. It doesn't really add anything new.
            – kos
            Oct 12 '15 at 16:48







          • 3




            @thinksinbinary Double-quotes are definetly not necessary. Try using single quotes instead, it will still work regardless.
            – kos
            Oct 12 '15 at 16:50












          • 6




            Using double-quotes doesn't change anything in this case, the problem is the space after the =
            – kos
            Oct 12 '15 at 16:35










          • There should not be any space between equal to
            – AVS
            Oct 12 '15 at 16:39










          • no, ABISHEK appears to be right, i had to remove the space and put in the quotes instead of the apostrophe
            – thinksinbinary
            Oct 12 '15 at 16:45










          • That I'm afraid still doesn't make the "use double-quotes" suggestion right. If you want to remove it, since it's wrong and misleading, I'll remove my downvote, however there's another answer pointing out the space problem which was posted 45 minutes before yours, so your answer is (aside from the single / double quotes thing) basically identical to the answer already present. It doesn't really add anything new.
            – kos
            Oct 12 '15 at 16:48







          • 3




            @thinksinbinary Double-quotes are definetly not necessary. Try using single quotes instead, it will still work regardless.
            – kos
            Oct 12 '15 at 16:50







          6




          6




          Using double-quotes doesn't change anything in this case, the problem is the space after the =
          – kos
          Oct 12 '15 at 16:35




          Using double-quotes doesn't change anything in this case, the problem is the space after the =
          – kos
          Oct 12 '15 at 16:35












          There should not be any space between equal to
          – AVS
          Oct 12 '15 at 16:39




          There should not be any space between equal to
          – AVS
          Oct 12 '15 at 16:39












          no, ABISHEK appears to be right, i had to remove the space and put in the quotes instead of the apostrophe
          – thinksinbinary
          Oct 12 '15 at 16:45




          no, ABISHEK appears to be right, i had to remove the space and put in the quotes instead of the apostrophe
          – thinksinbinary
          Oct 12 '15 at 16:45












          That I'm afraid still doesn't make the "use double-quotes" suggestion right. If you want to remove it, since it's wrong and misleading, I'll remove my downvote, however there's another answer pointing out the space problem which was posted 45 minutes before yours, so your answer is (aside from the single / double quotes thing) basically identical to the answer already present. It doesn't really add anything new.
          – kos
          Oct 12 '15 at 16:48





          That I'm afraid still doesn't make the "use double-quotes" suggestion right. If you want to remove it, since it's wrong and misleading, I'll remove my downvote, however there's another answer pointing out the space problem which was posted 45 minutes before yours, so your answer is (aside from the single / double quotes thing) basically identical to the answer already present. It doesn't really add anything new.
          – kos
          Oct 12 '15 at 16:48





          3




          3




          @thinksinbinary Double-quotes are definetly not necessary. Try using single quotes instead, it will still work regardless.
          – kos
          Oct 12 '15 at 16:50




          @thinksinbinary Double-quotes are definetly not necessary. Try using single quotes instead, it will still work regardless.
          – kos
          Oct 12 '15 at 16:50












          up vote
          20
          down vote













          You have a space between the = and the opening '. Remove it.



          $ alias foo= 'bar baz'
          bash: alias: bar baz: not found





          share|improve this answer


















          • 1




            Especially with bash -- it parses the commands into tokens by whitespace, so it's extremely sensitive to stray spaces.
            – glenn jackman
            Oct 12 '15 at 16:49














          up vote
          20
          down vote













          You have a space between the = and the opening '. Remove it.



          $ alias foo= 'bar baz'
          bash: alias: bar baz: not found





          share|improve this answer


















          • 1




            Especially with bash -- it parses the commands into tokens by whitespace, so it's extremely sensitive to stray spaces.
            – glenn jackman
            Oct 12 '15 at 16:49












          up vote
          20
          down vote










          up vote
          20
          down vote









          You have a space between the = and the opening '. Remove it.



          $ alias foo= 'bar baz'
          bash: alias: bar baz: not found





          share|improve this answer














          You have a space between the = and the opening '. Remove it.



          $ alias foo= 'bar baz'
          bash: alias: bar baz: not found






          share|improve this answer














          share|improve this answer



          share|improve this answer








          edited Oct 12 '15 at 15:35

























          answered Oct 12 '15 at 15:23









          glenn jackman

          11.8k2241




          11.8k2241







          • 1




            Especially with bash -- it parses the commands into tokens by whitespace, so it's extremely sensitive to stray spaces.
            – glenn jackman
            Oct 12 '15 at 16:49












          • 1




            Especially with bash -- it parses the commands into tokens by whitespace, so it's extremely sensitive to stray spaces.
            – glenn jackman
            Oct 12 '15 at 16:49







          1




          1




          Especially with bash -- it parses the commands into tokens by whitespace, so it's extremely sensitive to stray spaces.
          – glenn jackman
          Oct 12 '15 at 16:49




          Especially with bash -- it parses the commands into tokens by whitespace, so it's extremely sensitive to stray spaces.
          – glenn jackman
          Oct 12 '15 at 16:49












           

          draft saved


          draft discarded


























           


          draft saved


          draft discarded














          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f684635%2fwhy-is-my-alias-now-not-working%23new-answer', 'question_page');

          );

          Post as a guest













































































          Popular posts from this blog

          pylint3 and pip3 broken

          Missing snmpget and snmpwalk

          How to enroll fingerprints to Ubuntu 17.10 with VFS491