APLawrence.com -  Resources for Unix and Linux Systems, Bloggers and the self-employed

using dd

© December 2004 (various authors)
From: Tony Lawrence <tony@pcunix.com>
Subject: Re: Command Line Length, Upper Limit?
Date: Wed, 15 Jan 2003 20:16:03 GMT

Mark Conrad wrote:
> In article <JXbV9.687809$WL3.722374@rwcrnsc54>, Tony Lawrence
> <tony@pcunix.com> wrote:
>>>The main sticking point is that I don't know how to execute the
>>>necessary 3rd-party application "HexEdit" from the command-line.
>>AppleScript.  Which can be embedded in your shell script with osascript...
> Thanks for that tip, I looked at 'man osascript' and it looks like it
> would work.
>>However, why use Hexedit?  Looks to me (not that I've read carefully 
>>through that mess) like you  are just changing some bytes - put 'em 
>>in a file and use ddd to slap 'em  where you want them.
> I thought you would never ask<g>
> The reason I use HexEdit along with dd is because dd can't write to
> specific free-space bytes in certain areas of disk, like for example
> the Driver Descriptor Map area (absolute disk sector zero)

If dd can read it, dd can write it.  Or are you saying you don't know 
WHERE to write until you see it in hex edit?

You can skip right by bytes with dd and write any number of new bytes 
you like.  A simple example:

echo "AAAAAAAAAA" > /tmp/a
echo "BBB" > /tmp/b

dd if=/tmp/b bs=1 count=3 seek=2 conv=notrunc of=/tmp/a
cat /tmp/a

(notrunc is necessary with regular files; see the man page)

Got something to add? Send me email.

(OLDER)    <- More Stuff -> (NEWER)    (NEWEST)   

Printer Friendly Version

-> using dd

Inexpensive and informative Apple related e-books:

Are Your Bits Flipped?

El Capitan: A Take Control Crash Course

Take Control of Automating Your Mac

Take Control of IOS 11

Take Control of iCloud

Printer Friendly Version

Have you tried Searching this site?

This is a Unix/Linux resource website. It contains technical articles about Unix, Linux and general computing related subjects, opinion, news, help files, how-to's, tutorials and more.

Contact us

Printer Friendly Version

Tough times never last, but tough people do. (Robert H. Schuller)

Linux posts

Troubleshooting posts

This post tagged:


Unix/Linux Consultants

Skills Tests

Unix/Linux Book Reviews

My Unix/Linux Troubleshooting Book

This site runs on Linode

SCO Unix Sales, Support, & Service

Phone:  707-SCO-UNIX (707-726-8649Toll Free: 833-SCO-UNIX (833-726-8649)