Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 5 Aug 2010 17:49:43 GMT
From:      Paul Lambert <eb30750@gmail.com>
To:        freebsd-gnats-submit@FreeBSD.org
Subject:   misc/149335: shell script runs on Linux but not on freebsd
Message-ID:  <201008051749.o75HnhkG083963@www.freebsd.org>
Resent-Message-ID: <201008051750.o75HoAql071494@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>Number:         149335
>Category:       misc
>Synopsis:       shell script runs on Linux but not on freebsd
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    freebsd-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Thu Aug 05 17:50:09 UTC 2010
>Closed-Date:
>Last-Modified:
>Originator:     Paul Lambert
>Release:        8.,1-release
>Organization:
BRSINC
>Environment:
FreeBSD BRSINC-VM02.local 8.1-RELEASE FreeBSD 8.1-RELEASE #0: Mon Jul 19 02:36:49 UTC 2010     root@mason.cse.buffalo.edu:/usr/obj/usr/src/sys/GENERIC  amd64
>Description:
The script fails on these two lines so far; "stat" and "od"


# This won't work with non-GNU stat.
FILE_SIZE=`stat --format "%s" "$0"`
offset=$(($FILE_SIZE - 4))



   # XXX: put extraction in its own function
   MAGIC_NUMBER=`od -An -t u4 -N 4 -j $MAGIC_OFFSET "$file" | tr -d ' '`

   if [ "$MAGIC_NUMBER" != "907380241" ]; then
      echo "magic number does not match"
      #exit 1
   fi

>How-To-Repeat:


./prgm.bundle
>Fix:
The linux Bash version is 4.1.7(1) and the installed freebsd is 4.1.7(0)-release

>Release-Note:
>Audit-Trail:
>Unformatted:



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