top | item 13349374

(no title)

mlaux | 9 years ago

> It’s unique in its ability to issue seeks and reads of specific lengths, which enables a whole world of shell scripts that have no business being shell scripts. Want to simulate a lseek+execve? Use dd!

How would one simulate a call to execve with dd? Seems like a totally different problem domain.

discuss

order

kosma|9 years ago

There's a common idiom of skipping a file header and handing off processing to some other program, like this:

    cat foo | ( dd bs=$HEADERSIZE skip=1 of=/dev/null; process-foo-contents )

greenleafjacob|9 years ago

Isn't this the same as:

    tail -c +$HEADERSIZE <foo

fiddlerwoaroof|9 years ago

Cool, although this doesn't really help with my most common-case, skipping the first line.

    (head -1 > /dev/null; cat -) < file