Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 6 Aug 2010 19:35:14 +0200 (CEST)
From:      Oliver Fromme <olli@lurza.secnetix.de>
To:        freebsd-bugs@FreeBSD.ORG, freebsd-questions@FreeBSD.ORG, eb30750@gmail.com
Subject:   Re: misc/149335: shell script runs on Linux but not on freebsd
Message-ID:  <201008061735.o76HZEal051334@lurza.secnetix.de>
In-Reply-To: <B8BD4CE1-01CB-4C03-8D3E-2A8E29750A1D@gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
Redirected to the -questions.

Paul <eb30750@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:

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

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

-- 
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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201008061735.o76HZEal051334>