LinuxQuestions.org
Latest LQ Deal: Complete CCNA, CCNP & Red Hat Certification Training Bundle
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 03-08-2001, 07:28 PM   #1
chrishawk
LQ Newbie
 
Registered: Mar 2001
Location: Oregon
Posts: 3

Rep: Reputation: 0

I'm converting some unix scripts to run under linux. The entire process basically opens a .txt created under windows, does a dtox to strip the CR, processes the file, creating a new file, then needs to xtod the new file to put back the CR, after which it can be dealt with in windows. I'm successfully using tr to delete the CR when the file comes in from the windows side, but don't know how to insert the CR in my outgoing file. I've tried sed (sed 's/$/^M/' and sed 's/$/\r/', but neither one of those actually inserts a CR. Can someone please help? Thanks.
 
Old 03-14-2001, 10:25 PM   #2
jeremy
root
 
Registered: Jun 2000
Distribution: Debian, Red Hat, Slackware, Fedora, Ubuntu
Posts: 12,395

Rep: Reputation: 3297Reputation: 3297Reputation: 3297Reputation: 3297Reputation: 3297Reputation: 3297Reputation: 3297Reputation: 3297Reputation: 3297Reputation: 3297Reputation: 3297
There are a few utilities around to do this. One of them can be found here - http://www.megaloman.com/~hany/software/hd2u/
 
Old 03-15-2001, 12:12 AM   #3
chrishawk
LQ Newbie
 
Registered: Mar 2001
Location: Oregon
Posts: 3

Original Poster
Rep: Reputation: 0
dtox/xtod

Thanks, Jeremy. I'll download a copy. In the meantime, my boss sent me this little perl script that works great for the xtod portion:

perl -ne 'chop; print $_,"\r\n"'
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
link dies intermittently-seemingly at random- between win<->linux not linux<->linux?? takahaya Linux - Networking 10 03-09-2007 10:37 PM
triple boot linux/linux/linux No Windows involved toastermaker Linux - Newbie 12 03-02-2006 10:40 PM
Redhat (rhel v2.1) bootup problem with linux (linux vs linux-up) namgor Linux - Software 2 06-24-2004 02:49 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 11:50 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration