The Following User Says Thank You to fgevaerts For This Useful Post: | ||
![]() |
2011-01-04
, 17:25
|
Posts: 992 |
Thanked: 738 times |
Joined on Jun 2010
@ Low Earth Orbit
|
#12
|
tr -d "\r" < oldname.sh > newname.sh
The Following User Says Thank You to kureyon For This Useful Post: | ||
![]() |
2011-01-04
, 17:25
|
Posts: 244 |
Thanked: 354 times |
Joined on Jul 2010
@ Scotland
|
#13
|
One way would be
Or use an editor that can control this. I can't really recommend one though (I know vim can do it, but vim isn't really a good editor to recommend to someone who likes leafpad...)
:se ff=unix
The Following User Says Thank You to gregoranderson For This Useful Post: | ||
![]() |
2011-01-04
, 17:40
|
Posts: 244 |
Thanked: 354 times |
Joined on Jul 2010
@ Scotland
|
#14
|
[sbox-FREMANTLE_ARMEL: ~] > ./flip Usage: ./flip [-t|-u|-d|-m] filename[s] Converts ASCII files between Unix, MS-DOS/Windows, or Macintosh newline formats Options: -u = convert file(s) to Unix newline format (newline) -d = convert file(s) to MS-DOS/Windows newline format (linefeed + newline) -m = convert file(s) to Macintosh newline format (linefeed) -t = display current file type, no file modifications [sbox-FREMANTLE_ARMEL: ~] >
The Following User Says Thank You to gregoranderson For This Useful Post: | ||
![]() |
2011-01-04
, 19:27
|
|
Posts: 330 |
Thanked: 483 times |
Joined on Dec 2010
@ Norwich, UK
|
#15
|
You can remove the CRs (\r):
Or configure leafpad to save in unix format?Code:tr -d "\r" < oldname.sh > newname.sh
![]() |
2011-01-06
, 09:38
|
Posts: 6 |
Thanked: 2 times |
Joined on Nov 2010
@ United Kingdom
|
#16
|
The Following User Says Thank You to Late to the party For This Useful Post: | ||
![]() |
2011-01-06
, 17:30
|
|
Posts: 330 |
Thanked: 483 times |
Joined on Dec 2010
@ Norwich, UK
|
#17
|
Historical reasons:
http://en.wikipedia.org/wiki/Newline#History
tr -d '\015' < yourfile.sh > yournewfile.sh
(\015 means "octal 13", which is the CR or \r character)
Or use an editor that can control this. I can't really recommend one though (I know vim can do it, but vim isn't really a good editor to recommend to someone who likes leafpad...)