How do I insert x'0D' ?


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers How do I insert x'0D' ?
# 1  
Old 03-26-2008
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?
# 2  
Old 03-26-2008
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.)
# 3  
Old 03-26-2008
That did it! Thanks!
 
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Insert line

Hello Is there any sed command to insert a line after nth line... have a file of 500000 lines Thanks (4 Replies)
Discussion started by: Madiouma Ndiaye
4 Replies

2. Linux

How to insert EOL?

How can I insert End of line (EOL) in Unix to file. Thanks (5 Replies)
Discussion started by: mrn6430
5 Replies

3. UNIX for Dummies Questions & Answers

insert comma

my file looks like this: 297 PC Closed 07/10/12 999000098 AMERICAN SOCIETY FOR HEALTHCAR 0.00 USD 1 NAI i want to look line this: 297,PC,Closed,07/10/12,999000098,AMERICAN SOCIETY FOR HEALTHCAR,0.00,USD,1,NAI (4 Replies)
Discussion started by: lawsongeek
4 Replies

4. Shell Programming and Scripting

Search and Insert

Hi All I got one problem and want your help,what i want to do is Input 123 key0=A;B;C;:key1=X;Y;Z;: here 123 is a username I should search the username (in this case it is 123) in file and if found it should insert the additional string D as below Here 123 and key are tab seperated ... (6 Replies)
Discussion started by: parthmittal2007
6 Replies

5. Shell Programming and Scripting

Insert between lines.

Hello...I'm here again. This is the situation I want check if exist text between two lines: Example: interface description --text to verify ip adress if not exists text between 'interface' and 'ip address' i want insert the word 'no description' interface no description --if not... (4 Replies)
Discussion started by: bobbasystem
4 Replies

6. Shell Programming and Scripting

How to insert a char in every two?

Hi, I've written a script to interrogate all fibre devices on our systems and output the WWNs to a file. I now want to insert a ":" every 2 characters into the WWN so I can write another script to create aliases within the SAN. So the current file has WWNs in the following format;... (2 Replies)
Discussion started by: h8mmer
2 Replies

7. Shell Programming and Scripting

Insert Header Name

Can anyone help. I have sql to CSV showing header with ALIAS names but I want to generate CSV file with user friendly name i.e from AIAN8 to Adress Book Number etc. SELECT AIAN8 || , || F0101.ABALPH || , || AICO || showing following below in CSV output intead of above Address... (4 Replies)
Discussion started by: s1a2m3
4 Replies

8. Solaris

Not able to insert data

Hi All, I enhanced a perl script that creates a table with xyz_yyyymm and insert data from xyz table before truncate xyz.I have tested it successfully in dev but when i ran it on production new table xyz_yyyymm created but did not insert any records from xyz.(No errors were thrown)The perl... (1 Reply)
Discussion started by: megh
1 Replies

9. Shell Programming and Scripting

how to insert new coloum

Dear friends, I have a dataset like this 2.18 66.86 27.9 2.18 66.86 27.9 2.18 66.86 27.9 2.15 66.88 27.9 2.15 66.88 27.9 Now i have another dataset containing date coloum like this 22-12-2005 22-12-2005 22-12-2005 22-12-2005 22-12-2005 Now i want to... (3 Replies)
Discussion started by: rajan_ka1
3 Replies
Login or Register to Ask a Question