error: cp: cannot stat âÂÂrelease\-1.0.0r.jarâÂÂ: No such file or directory
Clash 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
linux cp
add a comment |Â
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
linux cp
add a comment |Â
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
linux cp
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
linux cp
asked Aug 10 at 20:11
itgeek
121
121
add a comment |Â
add a comment |Â
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'
That explains ther
, 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
 |Â
show 4 more comments
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'
That explains ther
, 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
 |Â
show 4 more comments
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'
That explains ther
, 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
 |Â
show 4 more comments
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'
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'
answered Aug 10 at 20:17
Kusalananda
106k14209327
106k14209327
That explains ther
, 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
 |Â
show 4 more comments
That explains ther
, 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
 |Â
show 4 more comments
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
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
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password