visitor (0 QPoints)
  • FR
  • EN
  • NL
  • DE
  • ES
315 experts, 1193 registered users, 1659 questions already answered
European Experts Exchange, the very best site for high-quality IT solutions

New Improved Search!

 


05/10/2011 1h30 : Steve Jobs is dead, the father of Apple ][ is gone, we are all orphaned.

Operating Systems :: Unix :: unix2dos


By: Bernard France  Date: 16/04/2006 09:22:40  English  Points: 20 Status: Answered
Quality : Excellent
Hello,

When I create a script file, it always displays with an extra blank line after each line, if I open it in a Windows-based text editor.

Someone said that I could enter:

unix2dos filename_unix_format new file_dos_format



The goal is that the file will look nice in Notepad.

When I telnet into my java box, what do I enter to convert the filename to DOS format ?
By: VGR Date: 16/04/2006 09:26:13 English  Type : Answer
hello,

it's true that there is a unix2dos() external command in some shells, and to check whether you've it in the path type :
unix2dos [CR]

to check that it is present but out of the $path, type :
whereis unix2dos [CR]
or (depending on distro)
locate unix2dos [CR]
if those fail miserably, you can resort to slow but efficient "find" command :
find / -name unix2dos -print

Also, note that running those commands as "root" does give you higher chances to find the command. Else, you'll see a lot of "access denied" erros for subdirectories of "/".

Now, if you don't find the unix2dos script on your system, you can play with "sed" to replace [CRLF] with [LF]

The best solution IMHO is to use a Windows text editor able to prevent single LF end of line markers. I can think of two :
- Wordpad (not Notepad)
- NoteTab Light
- UltraEdit or other overkill monsters (syntax highlighting, etc)

The two last ones can even convert enf-of-lines between systems or keep the original file format. This last option is definitely the best for you.

regards

Do register to be able to answer

EContact
browser fav
page generated in 287.070990 milliseconds

Why Google AdSense ads ?

compteur
 Ranking-Hits PageRank for this page