[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: bash3 on FreeBSD weirdness

From: Miek Gieben
Subject: Re: bash3 on FreeBSD weirdness
Date: Fri, 30 Jun 2006 09:14:42 +0200
User-agent: Vim/Mutt/Linux

[On 30 Jun, @07:32, Bob Proulx wrote in "Re: bash3 on FreeBSD weirdness ..."]
> > > > differently.  This happens all the time, mostly with ssh.
> I did not see a 'head' call anywhere in the script though.

The one in trunk/ is already fixed, look in tags/ for older versions.
I'm using a combination of 'dd' and 'read' now, which seems to work
both on Linux and FreeBSD.

> And the script processes it this way:
> > % ./rdup -c /dev/null bin | ./sh-tools/mirror.sh -c -b /tmp/storage
> > local_mirror() {
> >        declare -a path # catch spacing in the path
> >        while read -r mode uid gid psize fsize path
> > ...
> > remote_mirror() {
> >         while read -r mode uid gid psize fsize
> And I see Chet quoted this from some other message:
> > > Basicly the function local_mirror() (line 167) works, and
> > > remote_mirror() (line 257) doesn't (on FreeBSD that is).
> Here are my observations.  Does your script handle filenames with
> embedded newlines and other odd characters?

embedded newlines: no - they are not printed by the rdup utility -- I
check for that :)
Other meta characters are fine. You could not find a way to allow
newlines in file names... :-(

> It is possible that you have a data dependent failure.  You say you
> see differences between FreeBSD and GNU/Linux systems?  Is the input
> data to the script identical?  If not then I suspect a data dependent
> failure.  I suspect that the two data sets are different between the
> systems because you are walking filesystems and the filesystems will
> have unique data.  If you were to capture the input to a file and then
> feed the same file to both scripts on each platform do they then
> behave the same or different with identical input data?

I did not test with identical data, but on FreeBSD it would bail out
after the first line, where as on Linux it would continue. This
first line is the same in both cases: 
+16877 0 0 5 0

btw: if I use GNU head on FreeBSD in the script it works.

> You say the local_mirror works and the remote_mirror fails but the
> read code for each is different from each other.  It is not
> immediately clear to me why the code is different.  But doesn't that
> point to a problem here:
> > +16877 1000 20 11 0 /home/miekg
> >         while read -r mode uid gid psize fsize
> Won't fsize be "0 /home/miekg"?  Or am I missing something?

This 'while' is used here:
while read -r mode uid gid psize fsize path

So that works ok,

I could explain the workings of rdup but I think that is a bit
much for this bash list :)

  - Miek

  PGP: 6A3C F450 6D4E 7C6B C23C  F982 258B 85CF 3880 D0F6

Attachment: signature.asc
Description: Digital signature

reply via email to

[Prev in Thread] Current Thread [Next in Thread]