misc/149335: shell script runs on Linux but not on freebsd

Oliver Fromme olli at lurza.secnetix.de
Fri Aug 6 17:35:33 UTC 2010

Redirected to the -questions.

Paul <eb30750 at gmail.com> wrote:
 > What about matching the ' marks in this section?  I get a command error.
 > > >   # XXX: put extraction in its own function
 > > >   MAGIC_NUMBER=`od -An -t u4 -N 4 -j $MAGIC_OFFSET "$file" | tr -d ' '`

That command works fine for me:

$ file=/etc/motd
$ MAGIC_NUMBER=`od -An -t u4 -N 4 -j $MAGIC_OFFSET "$file" | tr -d ' '`

What's the exact error message that you get, and what are
the values of the variables involved?

By the way, when debugging shell scripts it is very helpful
to run the shell with -vx.  Then it prints the script as it
is being parsed, and additionally each command is printed
after expansion.

Best regards

Oliver Fromme, secnetix GmbH & Co. KG, Marktplatz 29, 85567 Grafing b. M.
Handelsregister: Registergericht Muenchen, HRA 74606,  Geschäftsfuehrung:
secnetix Verwaltungsgesellsch. mbH, Handelsregister: Registergericht Mün-
chen, HRB 125758,  Geschäftsführer: Maik Bachmann, Olaf Erb, Ralf Gebhart

FreeBSD-Dienstleistungen, -Produkte und mehr:  http://www.secnetix.de/bsd

"I invented Ctrl-Alt-Delete, but Bill Gates made it famous."
        -- David Bradley, original IBM PC design team

More information about the freebsd-questions mailing list