Unix/Linux Go Back    


UNIX for Dummies Questions & Answers This forum is closed for new posts. Please post beginner questions to learn unix and learn linux in this forum UNIX for Beginners Questions & Answers

How do I insert x'0D' ?

UNIX for Dummies Questions & Answers


 
 
Thread Tools Search this Thread Display Modes
    #1  
Old Unix and Linux 03-26-2008
rchuttke rchuttke is offline
Registered User
 
Join Date: Mar 2008
Last Activity: 28 March 2008, 2:24 PM EDT
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
How do I insert x'0D' ?

I'm directing output to a *.dat file. The first byte is a variable, the second must be a carriage-return (x'0D'). Is there a UNIX equivalent of an ASCII command that will allow me to output this byte?
Sponsored Links
    #2  
Old Unix and Linux 03-26-2008
era era is offline Forum Advisor  
Herder of Useless Cats (On Sabbatical)
 
Join Date: Mar 2008
Last Activity: 28 March 2011, 6:41 AM EDT
Location: /there/is/only/bin/sh
Posts: 3,653
Thanks: 0
Thanked 11 Times in 9 Posts
Nothing really easy is thoroughly standardized. Most systems these days would come with a printf(1) command. If you want to be 1970s compliant then maybe something like


Code:
echo | tr '\012' '\015'

(In case this is not obvious, a lone echo prints just a newline, and the tr converts it to something else; the codes understood by tr are, regrettably, in octal.)
Sponsored Links
    #3  
Old Unix and Linux 03-26-2008
rchuttke rchuttke is offline
Registered User
 
Join Date: Mar 2008
Last Activity: 28 March 2008, 2:24 PM EDT
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
That did it! Thanks!
Sponsored Links
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Linux More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Search and Insert parthmittal2007 Shell Programming and Scripting 6 01-31-2012 10:24 AM
insert txt in the row suryanarayana Shell Programming and Scripting 5 10-05-2009 08:38 AM
How to insert child job under a box job? xejatt UNIX for Dummies Questions & Answers 4 03-12-2008 04:08 PM
sed: how to insert tab? Juha Shell Programming and Scripting 2 10-29-2007 07:15 AM
Cut Paste and Insert Help PradeepRed Shell Programming and Scripting 5 12-09-2005 04:49 AM



All times are GMT -4. The time now is 12:46 AM.