Re: [Hampshire] Hex dump

Top Page
Author: Hugo Mills
Date:  
To: Hampshire LUG Discussion List
Subject: Re: [Hampshire] Hex dump

Reply to this message
gpg: failed to create temporary file '/var/lib/lurker/.#lk0x56781100.hantslug.org.uk.26417': Permission denied
gpg: keyblock resource '/var/lib/lurker/pubring.gpg': Permission denied
gpg: Signature made Sun Nov 23 22:24:31 2008 GMT
gpg: using DSA key 20ACB3BE515C238D
gpg: Can't check signature: No public key
On Sun, Nov 23, 2008 at 10:01:15PM -0000, Rob Malpass wrote:
> > ----- Original Message -----
> > From: "Hugo Mills" <hugo@???>
> > To: "Hampshire LUG Discussion List" <hampshire@???>
> > Sent: Sunday, November 23, 2008 9:48 PM
> > Subject: Re: [Hampshire] Hex dump
> >
> >
> >> $ hd foo.img
> >
> > Thanks Hugo. Interestingly enough - od's man page didn't come up with hd
> > in the "SEE ALSO" section which I personally think is often the most
> > useful
> > section of manpages!
>
> ...and forgive me replying to my own post but I've just noticed that hd is a
> link to hexdump on my system but if I do
>
> $ hd foo.img
>
> then I get what I want but if I do
>
> $ hexdump foo.img
>
> then I don't get the ASCII at the end. Very odd as hd and hexdump are
> effectively one and the same courtesy of the link. I'm obviously missing
> something here - anyone enlighten me? It's almost as though hd is some
> sort of batch file wrapper for hd with the correct syntax but the ls -l
> output gives me that it's a symbolic link.


This actually happens with a number of other binaries. They look at
the name they were called as, and modify their behaviour. For example,
/bin/bash changes behaviour to become more (POSIX) strict if it's
called as /bin/sh (as documented in the man page). Also, /bin/grep
runs without regular expressions if it's called as /bin/fgrep
(equivalent to grep -F), and uses extended regular expressions if
called as /bin/egrep (equivalent to grep -E).

Hugo.

-- 
=== Hugo Mills: hugo@... carfax.org.uk | darksatanic.net | lug.org.uk ===
  PGP key: 515C238D from wwwkeys.eu.pgp.net or http://www.carfax.org.uk
               --- emacs: Emacs Makes A Computer Slow. ---