Hi Helmut,
> Ralph Corderoy <[EMAIL PROTECTED]> writes:
> > Another alternative is
> >
> > cd /not/backup
> > tar -C /backup -cf /backup/tmp.tar $(cd /backup && ls tmp-*.txt)
> >
> > The shell first runs 'cd /backup && ls tmp-*.txt' and replaces the
> > $(...) with the command's output. It then runs tar.
>
> No. It's not an alternative: If the filenames which are reported by
> "ls" contain white space, the shell will split those filenames into
> words.
Point taken, but it was meant to illustrative of basic shell issues on a
system controlled by the user rather than a robust, catch anything
thrown at us, backup strategy. Filenames with spaces break most simple
/bin/sh scripting techniques anyway...
x=
for f; do
test -x $f && x="$x $f"
done
You have to muck around with later shells things like bash's arrays
instead.
Cheers,
Ralph.
_______________________________________________
Bug-tar mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/bug-tar