error: cp: cannot stat ‘release\-1.0.0r.jar’: No such file or directory

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











up vote
0
down vote

favorite












I have a file "release-1.0.0.jar" in the current working directory, and I'm trying to copy it to a directory "release_dir".



export t_version="1.0.0"

mkdir -p release_dir

cp release-$t_version.jar release_dir


error: cp: cannot stat ‘release\-1.0.0r.jar’: No such file or directory










share|improve this question

























    up vote
    0
    down vote

    favorite












    I have a file "release-1.0.0.jar" in the current working directory, and I'm trying to copy it to a directory "release_dir".



    export t_version="1.0.0"

    mkdir -p release_dir

    cp release-$t_version.jar release_dir


    error: cp: cannot stat ‘release\-1.0.0r.jar’: No such file or directory










    share|improve this question























      up vote
      0
      down vote

      favorite









      up vote
      0
      down vote

      favorite











      I have a file "release-1.0.0.jar" in the current working directory, and I'm trying to copy it to a directory "release_dir".



      export t_version="1.0.0"

      mkdir -p release_dir

      cp release-$t_version.jar release_dir


      error: cp: cannot stat ‘release\-1.0.0r.jar’: No such file or directory










      share|improve this question













      I have a file "release-1.0.0.jar" in the current working directory, and I'm trying to copy it to a directory "release_dir".



      export t_version="1.0.0"

      mkdir -p release_dir

      cp release-$t_version.jar release_dir


      error: cp: cannot stat ‘release\-1.0.0r.jar’: No such file or directory







      linux cp






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Aug 10 at 20:11









      itgeek

      121




      121




















          1 Answer
          1






          active

          oldest

          votes

















          up vote
          1
          down vote













          Your script was written on a Windows machine, or have aquired DOS line-endings some other way.



          This means that each line of the script has an extra carriage return character (r), which in turn means that the variable t_version has a value that is actually 1.0.0r, and that the directory that you create will actually be called release_dirr, etc.



          Convert the script file to a Unix text file using dos2unix:



          dos2unix myscript.sh


          And also delete that erroneously named directory (assuming you use bash):



          rmdir $'release_dirr'





          share|improve this answer




















          • That explains the r, but why \-?
            – RalfFriedl
            Aug 11 at 15:23











          • @RalfFriedl Unless the user is showing a modified script from what they ran, I can't really explain that. Note that the script as written would also generate two "command not found" errors for the carriage returns on the otherwise empty lines, so we're definitely are not seeing the script that was run.
            – Kusalananda
            Aug 11 at 15:47











          • I don't criticize your answer, just wondering.
            – RalfFriedl
            Aug 11 at 15:51










          • @RalfFriedl I didn't think you were, just explaining.
            – Kusalananda
            Aug 11 at 15:53










          • I tried running these commands in redhat7 Linux machine command line terminal, not in windows. export t_version="1.0.0" mkdir -p release_dir cp release-$t_version.jar release_dir I also tried your suggessted solution its still giving same error.
            – itgeek
            Aug 12 at 23:44










          Your Answer







          StackExchange.ready(function()
          var channelOptions =
          tags: "".split(" "),
          id: "106"
          ;
          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: false,
          noModals: false,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: null,
          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%2funix.stackexchange.com%2fquestions%2f461892%2ferror-cp-cannot-stat-release-1-0-0-r-jar-no-such-file-or-directory%23new-answer', 'question_page');

          );

          Post as a guest






























          1 Answer
          1






          active

          oldest

          votes








          1 Answer
          1






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes








          up vote
          1
          down vote













          Your script was written on a Windows machine, or have aquired DOS line-endings some other way.



          This means that each line of the script has an extra carriage return character (r), which in turn means that the variable t_version has a value that is actually 1.0.0r, and that the directory that you create will actually be called release_dirr, etc.



          Convert the script file to a Unix text file using dos2unix:



          dos2unix myscript.sh


          And also delete that erroneously named directory (assuming you use bash):



          rmdir $'release_dirr'





          share|improve this answer




















          • That explains the r, but why \-?
            – RalfFriedl
            Aug 11 at 15:23











          • @RalfFriedl Unless the user is showing a modified script from what they ran, I can't really explain that. Note that the script as written would also generate two "command not found" errors for the carriage returns on the otherwise empty lines, so we're definitely are not seeing the script that was run.
            – Kusalananda
            Aug 11 at 15:47











          • I don't criticize your answer, just wondering.
            – RalfFriedl
            Aug 11 at 15:51










          • @RalfFriedl I didn't think you were, just explaining.
            – Kusalananda
            Aug 11 at 15:53










          • I tried running these commands in redhat7 Linux machine command line terminal, not in windows. export t_version="1.0.0" mkdir -p release_dir cp release-$t_version.jar release_dir I also tried your suggessted solution its still giving same error.
            – itgeek
            Aug 12 at 23:44














          up vote
          1
          down vote













          Your script was written on a Windows machine, or have aquired DOS line-endings some other way.



          This means that each line of the script has an extra carriage return character (r), which in turn means that the variable t_version has a value that is actually 1.0.0r, and that the directory that you create will actually be called release_dirr, etc.



          Convert the script file to a Unix text file using dos2unix:



          dos2unix myscript.sh


          And also delete that erroneously named directory (assuming you use bash):



          rmdir $'release_dirr'





          share|improve this answer




















          • That explains the r, but why \-?
            – RalfFriedl
            Aug 11 at 15:23











          • @RalfFriedl Unless the user is showing a modified script from what they ran, I can't really explain that. Note that the script as written would also generate two "command not found" errors for the carriage returns on the otherwise empty lines, so we're definitely are not seeing the script that was run.
            – Kusalananda
            Aug 11 at 15:47











          • I don't criticize your answer, just wondering.
            – RalfFriedl
            Aug 11 at 15:51










          • @RalfFriedl I didn't think you were, just explaining.
            – Kusalananda
            Aug 11 at 15:53










          • I tried running these commands in redhat7 Linux machine command line terminal, not in windows. export t_version="1.0.0" mkdir -p release_dir cp release-$t_version.jar release_dir I also tried your suggessted solution its still giving same error.
            – itgeek
            Aug 12 at 23:44












          up vote
          1
          down vote










          up vote
          1
          down vote









          Your script was written on a Windows machine, or have aquired DOS line-endings some other way.



          This means that each line of the script has an extra carriage return character (r), which in turn means that the variable t_version has a value that is actually 1.0.0r, and that the directory that you create will actually be called release_dirr, etc.



          Convert the script file to a Unix text file using dos2unix:



          dos2unix myscript.sh


          And also delete that erroneously named directory (assuming you use bash):



          rmdir $'release_dirr'





          share|improve this answer












          Your script was written on a Windows machine, or have aquired DOS line-endings some other way.



          This means that each line of the script has an extra carriage return character (r), which in turn means that the variable t_version has a value that is actually 1.0.0r, and that the directory that you create will actually be called release_dirr, etc.



          Convert the script file to a Unix text file using dos2unix:



          dos2unix myscript.sh


          And also delete that erroneously named directory (assuming you use bash):



          rmdir $'release_dirr'






          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered Aug 10 at 20:17









          Kusalananda

          106k14209327




          106k14209327











          • That explains the r, but why \-?
            – RalfFriedl
            Aug 11 at 15:23











          • @RalfFriedl Unless the user is showing a modified script from what they ran, I can't really explain that. Note that the script as written would also generate two "command not found" errors for the carriage returns on the otherwise empty lines, so we're definitely are not seeing the script that was run.
            – Kusalananda
            Aug 11 at 15:47











          • I don't criticize your answer, just wondering.
            – RalfFriedl
            Aug 11 at 15:51










          • @RalfFriedl I didn't think you were, just explaining.
            – Kusalananda
            Aug 11 at 15:53










          • I tried running these commands in redhat7 Linux machine command line terminal, not in windows. export t_version="1.0.0" mkdir -p release_dir cp release-$t_version.jar release_dir I also tried your suggessted solution its still giving same error.
            – itgeek
            Aug 12 at 23:44
















          • That explains the r, but why \-?
            – RalfFriedl
            Aug 11 at 15:23











          • @RalfFriedl Unless the user is showing a modified script from what they ran, I can't really explain that. Note that the script as written would also generate two "command not found" errors for the carriage returns on the otherwise empty lines, so we're definitely are not seeing the script that was run.
            – Kusalananda
            Aug 11 at 15:47











          • I don't criticize your answer, just wondering.
            – RalfFriedl
            Aug 11 at 15:51










          • @RalfFriedl I didn't think you were, just explaining.
            – Kusalananda
            Aug 11 at 15:53










          • I tried running these commands in redhat7 Linux machine command line terminal, not in windows. export t_version="1.0.0" mkdir -p release_dir cp release-$t_version.jar release_dir I also tried your suggessted solution its still giving same error.
            – itgeek
            Aug 12 at 23:44















          That explains the r, but why \-?
          – RalfFriedl
          Aug 11 at 15:23





          That explains the r, but why \-?
          – RalfFriedl
          Aug 11 at 15:23













          @RalfFriedl Unless the user is showing a modified script from what they ran, I can't really explain that. Note that the script as written would also generate two "command not found" errors for the carriage returns on the otherwise empty lines, so we're definitely are not seeing the script that was run.
          – Kusalananda
          Aug 11 at 15:47





          @RalfFriedl Unless the user is showing a modified script from what they ran, I can't really explain that. Note that the script as written would also generate two "command not found" errors for the carriage returns on the otherwise empty lines, so we're definitely are not seeing the script that was run.
          – Kusalananda
          Aug 11 at 15:47













          I don't criticize your answer, just wondering.
          – RalfFriedl
          Aug 11 at 15:51




          I don't criticize your answer, just wondering.
          – RalfFriedl
          Aug 11 at 15:51












          @RalfFriedl I didn't think you were, just explaining.
          – Kusalananda
          Aug 11 at 15:53




          @RalfFriedl I didn't think you were, just explaining.
          – Kusalananda
          Aug 11 at 15:53












          I tried running these commands in redhat7 Linux machine command line terminal, not in windows. export t_version="1.0.0" mkdir -p release_dir cp release-$t_version.jar release_dir I also tried your suggessted solution its still giving same error.
          – itgeek
          Aug 12 at 23:44




          I tried running these commands in redhat7 Linux machine command line terminal, not in windows. export t_version="1.0.0" mkdir -p release_dir cp release-$t_version.jar release_dir I also tried your suggessted solution its still giving same error.
          – itgeek
          Aug 12 at 23:44

















           

          draft saved


          draft discarded















































           


          draft saved


          draft discarded














          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f461892%2ferror-cp-cannot-stat-release-1-0-0-r-jar-no-such-file-or-directory%23new-answer', 'question_page');

          );

          Post as a guest













































































          Popular posts from this blog

          How to check contact read email or not when send email to Individual?

          Displaying single band from multi-band raster using QGIS

          How many registers does an x86_64 CPU actually have?