LinuxQuestions.org
Help answer threads with 0 replies.
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 11-07-2012, 09:32 AM   #1
xombboxer
Member
 
Registered: Apr 2011
Posts: 63

Rep: Reputation: 0
How to insert a string into a binary file


I want insert actual string into binary file, not the acsii value of the string

Its kind of xxd -r, but I am not getting intended result.
how can i do that ?
 
Old 11-07-2012, 09:58 AM   #2
crabboy
Senior Member
 
Registered: Feb 2001
Location: Atlanta, GA
Distribution: Slackware
Posts: 1,823

Rep: Reputation: 120Reputation: 120
What exactly are you trying to accomplish? Adding anything to a binary file will likely corrupt the file and make whatever program that reads the file unable to read it.

You can append text to any file with the >> shell operator. but again your file will be corrupt.

Code:
echo "appended text" >> somebinary
You can probably get away with replacing text in a binary so long as the text is the same length before and after.
 
Old 11-07-2012, 09:59 AM   #3
michaelk
Moderator
 
Registered: Aug 2002
Posts: 16,350

Rep: Reputation: 1908Reputation: 1908Reputation: 1908Reputation: 1908Reputation: 1908Reputation: 1908Reputation: 1908Reputation: 1908Reputation: 1908Reputation: 1908Reputation: 1908
Reference:
http://www.linuxquestions.org/questi...le-4175436027/
 
  


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
How to use Vi to match a string of text, add a new line, insert string... Slycraft Linux - Newbie 7 07-20-2012 11:24 AM
[SOLVED] How to insert binary value into array with fixed length of 10 digits jamesd_burgess Linux - Newbie 4 01-09-2012 02:49 PM
Help: Opening GenICs binary file, writing to binary file for GADGET-2 (in C) parallax147 Programming 0 10-05-2010 12:06 PM
Script to insert string in first line of a file minil Programming 13 01-03-2006 12:56 AM
Java read binary file in as string for RegEx mulciber Programming 1 12-18-2005 01:36 PM

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

All times are GMT -5. The time now is 03:22 AM.

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