any pitfalls to using $dos2unix function?


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers any pitfalls to using $dos2unix function?
# 1  
Old 10-28-2002
Question any pitfalls to using $dos2unix function?

Greetings-
are there any pitfalls/costs/etc to be aware of using the "$dos2unix <filename>" utility in Solaris 8? does it really work as simply as it's described / recommended in other threads ?

We want to establish the procedure / develop a script or procedure to automatically strip out ^M characters from dos-edited files transferred up to a Solaris 8 box, but want to be sure that we're not creating any other headaches by using this-

thanks for sharing any experiences with this-
# 2  
Old 10-28-2002
File formats on UNIX and other platforms (win, mac) differ in the way they interpret newline char (LF on UNIX, CRLF on win, CR on mac)... I have used dos2ux on hp-ux and I didn't see any problems with it..

as I expected it replaced CRLF with a LF so that I don't see the ^M (vi shows a CR as ^M)...

if you want to verify it in a test that nothing else is changed, you can try sed or some utility to add a CR to the dos2ux output and reverse compare it with the original dos file

fyi, CR = 015 and LF = 012 in octal...
 
Login or Register to Ask a Question

Previous Thread | Next Thread

7 More Discussions You Might Find Interesting

1. Solaris

Solaris Zones: traps and pitfalls

Hi all Solaris Experts, What are the traps and pitfalls in using Solaris zones? Specifically, what tools, utilities, system calls don't work or work differently in a non-global zone? I'm new to zones and I've already encountered one difference which is very significant to me: orphan... (5 Replies)
Discussion started by: ad101
5 Replies

2. Shell Programming and Scripting

Return for Dos2UNIX

Hi, I have to test to see if dos2unix is installed on the machine. Right now I am typing in dos2unix and hitting ctrl C. Is there a better workaround for this. If dos2unix is there is need to print the statement saying its there and vice versa. How can i accomplish this. thank you in... (1 Reply)
Discussion started by: tarreddy
1 Replies

3. Shell Programming and Scripting

problem with dos2unix command

hi friends i am using the dos2unix command to remove the ^M characters coming at the end of each line , but i getting the folowing message: > dos2unix file.sql could not open /dev/kbd to get keyboard type US keyboard assumed could not get keyboard type US keyboard assumed ---------file... (6 Replies)
Discussion started by: neelmani
6 Replies

4. UNIX for Dummies Questions & Answers

return value of dos2unix

if (my $temp2=$b2e_r->cmd(cmd=>"dos2unix $b2e_file_name")) Even if it fails as, Jul 25 17:17:02 dos2unix /volume/systest/hello_manoj.results dos2unix /volume/systest/hello_manoj.results dos2unix: converting file /volume/systest/hello_manoj.results to UNIX format ... Failed to open... (3 Replies)
Discussion started by: manojn
3 Replies

5. Shell Programming and Scripting

dos2unix

hi, need some urgent inputs..... I have a folder, which has both files and directories as its contents. I want to convert all the files (Excluding the directories) from dos to unix mode using the command 'dos2unix'..... please can any one help me in providing the command to convert... (3 Replies)
Discussion started by: cmaroju
3 Replies

6. UNIX for Dummies Questions & Answers

Regarding dos2unix command

Hi, Does anyone know, how to use dos2unix command for binary files? When i am using the command, the binary file gets converted to ASCII file. I want binary file to remain in the binary format. (4 Replies)
Discussion started by: agarwal
4 Replies

7. UNIX for Advanced & Expert Users

Asking on dos2unix syntax

Hi, like to ask why when i tried to run my .sh file to convert maybe a text file using dos2unix -ascii ${DATAFILE5} ${DATAFILE5} i got an error saying : could not open /dev/kbd to get keyboard type US keyboard assumed could not get keyboard type US keyboard assumed Is it because we dun like... (4 Replies)
Discussion started by: blueberry80
4 Replies
Login or Register to Ask a Question