Active Topics

 


Reply
Thread Tools
Posts: 6 | Thanked: 7 times | Joined on Jan 2010
#11
One way would be
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...)
 

The Following User Says Thank You to fgevaerts For This Useful Post:
Posts: 992 | Thanked: 738 times | Joined on Jun 2010 @ Low Earth Orbit
#12
Originally Posted by FRuMMaGe View Post
How do I correct this?
You can remove the CRs (\r):
Code:
tr -d "\r" < oldname.sh > newname.sh
Or configure leafpad to save in unix format?
 

The Following User Says Thank You to kureyon For This Useful Post:
Posts: 244 | Thanked: 354 times | Joined on Jul 2010 @ Scotland
#13
Originally Posted by fgevaerts View Post
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...)
Just for completeness, in vim you would use the set fileformat instruction:

Code:
:se ff=unix
Vim on the old N900 keyboard is tricky, but it's been your main tool for year then you get used to it (especially if you have gathered together a hefty vimrc file in that time).

http://vim.wikia.com/wiki/File_format
 

The Following User Says Thank You to gregoranderson For This Useful Post:
Posts: 244 | Thanked: 354 times | Joined on Jul 2010 @ Scotland
#14
I've compiled flip for you (see https://ccrma.stanford.edu/~craig/utility/flip/). Dead easy to check for file formats and flip between them.

Code:
[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: ~] >
Attached Files
File Type: gz flip-maemo5-arm.tar.gz (30.0 KB, 154 views)
 

The Following User Says Thank You to gregoranderson For This Useful Post:
FRuMMaGe's Avatar
Posts: 330 | Thanked: 483 times | Joined on Dec 2010 @ Norwich, UK
#15
Originally Posted by kureyon View Post
You can remove the CRs (\r):
Code:
tr -d "\r" < oldname.sh > newname.sh
Or configure leafpad to save in unix format?
Thanks to everyone, this method worked.

Just out of interest, wtf?
__________________
OMNOM: Pacman-like game now in extras-devel

fAircrack (Aircrack GUI): Point-and-click pwnage for your N900
Now with John the Ripper integration
 
Posts: 6 | Thanked: 2 times | Joined on Nov 2010 @ United Kingdom
#16
Originally Posted by FRuMMaGe View Post
Thanks to everyone, this method worked.

Just out of interest, wtf?
Historical reasons:

http://en.wikipedia.org/wiki/Newline#History
 

The Following User Says Thank You to Late to the party For This Useful Post:
FRuMMaGe's Avatar
Posts: 330 | Thanked: 483 times | Joined on Dec 2010 @ Norwich, UK
#17
Originally Posted by Late to the party View Post
Historical reasons:

http://en.wikipedia.org/wiki/Newline#History
Thanks. Very informative
 
Reply


 
Forum Jump


All times are GMT. The time now is 12:18.