unix2dos?


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting unix2dos?
# 1  
Old 08-07-2011
unix2dos?

HI there !

can you please explain me about "unix2does" command like >> when we used ? what it does ? ...
# 2  
Old 08-07-2011
unix2dos, the program that converts text files in UNIX format to DOS format.
# 3  
Old 08-07-2011
oh thanks dude .. do u have any idea when will we use this in the UNIX script??
# 4  
Old 08-07-2011
unix2dos is a Unix tool to convert an ASCII text file from Unix format (line break) to DOS format (carriage return and line break) and vice versa. When invoked as unix2dos the program will convert a Unix text file to DOS format, when invoked as dos2unix it will convert a DOS text file to UNIX format.
When to use it , simply it depends on your needs one good example if you have bunch of files and you want to automate the process of conversion between UNIX ASCII text format to Windows ASCII text format and vice versa , Just invoke unix2dos from a script.
Here some alternatives to unix2dos in PERL and sed
Code:
$ perl -i -p -e 's/\n/\r\n/' file
$ sed -i -e 's/$/\r/' file

and the reverse operation in some native UNIX tools such tr
Code:
$ tr -d '\r' < file > file2
$ perl -i -p -e 's/\r//' file
$ sed -i -e 's/\r//' file

Login or Register to Ask a Question

Previous Thread | Next Thread

3 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Script exits when using UNIX2dos / dos2UNIX

I'm not sure why but my script quits automatically at the point where unix2dos / dos2unix command is used. :confused::confused::confused: How do a fix it? LOG_FILE=MADDY.txt unix2dos ${LOG_FILE} exec 2> $LOG_FILE 1>&2 echo ${LOG_FILE} The script exists after the below... (3 Replies)
Discussion started by: machomaddy
3 Replies

2. Shell Programming and Scripting

Using unix2dos command in the below script

Hi, Please help me in implemeting unix2dos command so that report output which comes as the attachment through mail is in the proper format Am using uuencode fro attaching one report which is nothing but sql query output. But when i receive the report through attachement and when it is... (2 Replies)
Discussion started by: weknowd
2 Replies

3. Windows & DOS: Issues & Discussions

unix script and unix2dos conversion

Hi, I am a newbie and do not have much experience using unix. But I have been trying to understand it. I found the following unix script typeset -i n=0 while do sleep 5 echo "${n}:Fluent is running...." n=${n}+1 done I have the following doubts: 1) In the first line - I am aware... (1 Reply)
Discussion started by: karthiksrao
1 Replies
Login or Register to Ask a Question