Post a reply

Before posting, please read how to report bug or request support effectively.

Bug reports without an attached log file are usually useless.

Options
Add an Attachment

If you do not want to add an Attachment to your Post, please leave the Fields blank.

(maximum 10 MB; please compress large files; only common media, archive, text and programming file formats are allowed)

Options

Topic review

martin

Re: Is WinSCP able to convert CR/LF end-of-lines to just LF on uploading?

Aza wrote:

Can WinSCP perform the conversion on uploading?

Of course.
See https://winscp.net/eng/docs/transfer_mode
Aza

Is WinSCP able to convert CR/LF end-of-lines to just LF on uploading?

The thesis that the End Of Line character is CR/LF (0x0D 0x0A)when *nix wants only LF (0x0A) sounds reasonable. I am indeed uploading CentOS shell scripts authored on Windows 10.

Can WinSCP perform the conversion on uploading?

Regards,

Aza
martin

Re: Uploaded CentOS shell scripts won't execute until opened & saved in WinSCP editor

You most probably use Windows EOLs for a local file. And you then upload it using a binary mode. So Windows EOLs are preserved. *nix shells do not like that.

While, when a file is edited in WinSCP internal editor, text/ascii mode is enforced. So EOLs are converted to *nix style.
Aza

Uploaded CentOS shell scripts won't execute until opened & saved in WinSCP editor

If I simply upload the script with WinSCP 5.9.5 and set permissions the script will not run in the PuTTY box.

The script will run in the Putty box if i simply open and save the script using the WinSCP editor.

As far as I can tell no ownerships or permissions are altered by the editor open/save.

When this "MyScript.sh" bash script I'm working with fails on CentOS Linux release 7.3.1611 (Core), I get the following error:

-bash: ./MyScript.sh: /bin/bash^M: bad interpreter: No such file or directory

It's odd but not the end of the earth because once you reopen and save using the WinSCP editor the script runs reliably.

Regards,

Aza D. Oberman