On Fri, Jan 04, 2002 at 01:18:50AM +0100, Alfred M. Szmidt wrote:
> I changed it back to the original version but modified it a bit so it
> works under a POSIX shell.  Currently its a really ugly hack, so if
> you have any suggestions on how one could do it differently please
> tell me.

Before you break your head over trying to understand why the code works,
here are a few notes (if you are training for the obfuscated shell contest,
don't read on):

The -c option makes sure all nodes exist, even if the glob is failing.  So
you might end up with empty files like '*' or '.??*'.

local variables are not supported by POSIX.  We get away with using a
recursive function anyway because it is mostly tail recursive.  The only
problem is the "rmdir $f", which comes after the recursion and uses a local
variable.  The dirname $f makes up for this case, because the only thing
that happens after the recursion is that $f has a path element more than
before.

It is black magic, but it seems to work :)

Thanks,
Marcus

-- 
`Rhubarb is no Egyptian god.' Debian http://www.debian.org [EMAIL PROTECTED]
Marcus Brinkmann              GNU    http://www.gnu.org    [EMAIL PROTECTED]
[EMAIL PROTECTED]
http://www.marcus-brinkmann.de

_______________________________________________
Bug-hurd mailing list
[EMAIL PROTECTED]
http://mail.gnu.org/mailman/listinfo/bug-hurd

Reply via email to