I'm using Ubuntu on a Jetson Nano, where I have a shell script named A.sh that somebody else created. This file is running smoothly. I open the file in an editor and press Ctrl-A, Ctrl-C to copy all of the contents. I then make B.sh and open it in the same editor and paste it. I save it and run it; it doesn't work, and I get errors related to "directory not found". I make sure that the permissions are the same for both A and B and it still doesn't work. I then copy the same file, and paste it, naming it A1.sh. I run it and this file works now. I am not sure what could be causing this. A.sh and A1.sh are 857 bytes. B.sh is 866 bytes. Where are these extra bytes coming from? I'm assuming that there is some meta data that is different in the two files, so how do I fix it? Is there anything else that could be causing it?
Asked
Active
Viewed 13 times
0
-
1One of your files is saved in CRLF. – konsolebox Feb 15 '23 at 15:13
-
_Which_ editor? The obvious explanation is that you're using some editor built for Windows that doesn't save in UNIX text format. – Charles Duffy Feb 15 '23 at 15:34