Editing batch files

Advertisement

percheron
Joined:
Posts:
1
Location:
Hartwell, Georgia

Editing batch files

I am using WinSCP 3.7.4 (build 271) accessing Linux servers. I use the Norton command interface.

I often edit both Unix and Windows text files on these servers. Example: netlogon.bat and numerous *.cmd or *.bat files in Windows cr/lf text format, as well as Unix scripts in lf format.

My problem is that when I edit a batch file such as netlogon.bat with the internal WinSCP editor, it strips out the carriage returns and makes it unreadable by the Winodows machines.

Likewise, I do not want to introduce carriage returns in the Unix shell scripts and other similar files.

I have tried numerous combinations of the various settings in WinSCP and can't seem to hit on the right method. I have searched this forum and the web in general but have not seen this problem specifically addressed.

I would very much prefer to use the internal editor vs notepad. Also I frequently have to download WinSCP on a client's machine to access the server so I don't want to carry along another editor program. However, I would welcome a suggestion for an editor that would deal with this problem.

Is there a recommended combination of settings to easily handle both Windows and Unix script files?

Thanks for a great product!
_________________
jim

Reply with quote

Advertisement

martin
Site Admin
martin avatar
Joined:
Posts:
41,518
Location:
Prague, Czechia

Re: Editing batch files

Internal editor works only with Windows style line endings. So WinSCP always converts the remote file before it opens it in the internal editor (an coverts it back when upliding the file back). Problem is that WinSCP does not expect presence of text files in different formats on remote server.

So unfortunatelly to solve your problem you need to use external editor that supports both unix and windows style text files and make sure you use binary transfer mode when downloading to/uploading from the editor. See Editing binary files.

About editor: I use integrated editor of my favourite file manager (FAR). However I believe that you won't have problem finding some (try PSPad.com and UltraEdit.com).

Reply with quote

Advertisement

You can post new topics in this forum