From owner-freebsd-bugs Fri Oct 18 6:30:10 2002 Delivered-To: freebsd-bugs@hub.freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 6F5C837B404 for ; Fri, 18 Oct 2002 06:30:07 -0700 (PDT) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id 28DB443E7B for ; Fri, 18 Oct 2002 06:30:07 -0700 (PDT) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.12.6/8.12.6) with ESMTP id g9IDU6x3084578 for ; Fri, 18 Oct 2002 06:30:07 -0700 (PDT) (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.12.6/8.12.6/Submit) id g9IDU629084577; Fri, 18 Oct 2002 06:30:06 -0700 (PDT) Date: Fri, 18 Oct 2002 06:30:06 -0700 (PDT) Message-Id: <200210181330.g9IDU629084577@freefall.freebsd.org> To: freebsd-bugs@FreeBSD.org Cc: From: abc@anchorageinternet.org Subject: Re: gnu/44196: tar (sort option) Reply-To: abc@anchorageinternet.org Sender: owner-freebsd-bugs@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org The following reply was made to PR gnu/44196; it has been noted by GNATS. From: abc@anchorageinternet.org To: Peter Pentchev Cc: Subject: Re: gnu/44196: tar (sort option) Date: Fri, 18 Oct 2002 13:23:33 GMT > > > > >Number: 44196 > > > > >Category: gnu > > > > >Synopsis: tar (sort option) > > > > >Originator: Joe Public > > > > >Release: i386 FreeBSD 4.7-RELEASE > > > > >Organization: > > > > no org > > > > >Environment: > > > > ^^^^^^^^^^^^^^^^^^^^^^^^ > > > > >Description: > > > > tar is LONG overdue for a sort option. > > > > >How-To-Repeat: > > > > find -s/xargs/tar is a kludge and doesn't > > > > preserve owner/perms nor empty directories. > > > > > > What exactly is it that you are trying to do? IMHO, tar(1) does a very > > > good job of preserving file access attributes, when presented with the > > > right command-line parameters.. > > > > find -s "$I" ! -type d | xargs tar rvf "$I.tar" && \ > > && gzip -f9 "$I.tar" && mv "$I.tar.gz" "$I.tgz" > > > > this is the only way i know to create a *.tgz archive > > of a directory tree, and i am leaving out the "rm" to > > insure no pre-existing *.tar archive exists, since > > you are forced to use tar's "append" mode to > > accomplish such a task. > > OK, then, how about tar(1)'s -T (or -I, or --files-from) option? :) > Something like.. > > find -s "$I" \! -type d > files.lst > tar -czf "$I.tgz" -T files.lst > > Or, even a bit simpler, using the standard Unix convention that '-' > as a file name means the standard input (or output, as appropriate): > > find -s "$I" \! -type d | tar -czf "$I.tgz" -T - > > Would that work for you? > > G'luck, > Peter -T !!! works great :) :) :) thanks! i don't know how i missed that option. thank you, and i apologize for wasting your time on that ... thanks. To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-bugs" in the body of the message