This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 250883 - sync file between windows and linux will change file endings which cause linux bash file fail to run because of '\r'
Summary: sync file between windows and linux will change file endings which cause linu...
Status: RESOLVED WORKSFORME
Alias: None
Product: cnd
Classification: Unclassified
Component: Remote (show other bugs)
Version: 8.0.2
Hardware: PC Windows 7
: P3 normal (vote)
Assignee: issues@cnd
URL:
Keywords: THREAD
Depends on:
Blocks:
 
Reported: 2015-03-04 03:15 UTC by exitna
Modified: 2015-05-13 08:22 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
IDE 日志 (42.32 KB, text/plain)
2015-03-04 03:15 UTC, exitna
Details

Note You need to log in before you can comment on or make changes to this bug.
Description exitna 2015-03-04 03:15:17 UTC
Product Version = NetBeans IDE 8.0.2 (Build 201411181905)
Operating System = Windows 7 version 6.1 running on amd64
Java; VM; Vendor = 1.8.0_31
Runtime = Java HotSpot(TM) 64-Bit Server VM 25.31-b07

in auto copying mode of remote C++ development:
original file ending is unix type, by when sync from windows to linux, netbeans will change file ending to windows type.
this will cause the bash scipt fail to run.
Comment 1 exitna 2015-03-04 03:15:28 UTC
Created attachment 152385 [details]
IDE 日志
Comment 2 Ondrej Vrabec 2015-03-04 08:11:48 UTC
> in auto copying mode of remote C++ development:
cnd/remote issue ?
Comment 3 Vladimir Kvashin 2015-05-13 08:22:53 UTC
(In reply to exitna from comment #0)
> original file ending is unix type, by when sync from windows to linux,
> netbeans will change file ending to windows type.
I don't think the statement is correct. Transfers to remote are always binary.
I guess the reason is that the file is saved (locally) with incorrect line endings.

Please check this.

I tried to reproduce this on Windows (using NetBeans development version), but failed. I tried creating script files via 4 ways:
- Via New > Other > Shell Scripts
- Via New > Other > Empth file (and then .sh extension)
- Via creating an empty file with .sh externally
- Via creating a non empty script externally (on remote host, to ensure

In each case line endings were correct.
And sure I double checked that they are transferred to the host correctly.

I'm sure that you once edited your file with an external tool? (such as Notepad or so) and this tool wrote file back with Windows endings?

If the above is not correct, then please describe how to reproduce your situation.