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

Re: Bash question: get output as a variable?



Ken Teague wrote:
On Fri, Feb 5, 2010 at 12:39 AM, bruno <bruno.debian@cyberoso.com> wrote:
Why not simply use the  t option for content listing :

tar tvf  * --exclude-from $EXCLUDES

He's already creating the archive with -v.  Why process the archive a
2nd time just to get a listing when it comes from stdout the 1st time?


because it's a simplier way to get the list into a variable
because the script gets much clearer
because it is not safe to rely on stderr since it is supposed to display errors, which it might do as well because he would get the list of the files that have really been compressed, not just the processed ones because the overhead may not be worth the complication of trying to do both things at the same time because he might as well never use the v option (it's not useful in my proposition either, and it would even reduce the overhead)

because it is another way to do it and nobody had proposed it before


Bruno


Reply to: