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

Re: Bash question: get output as a variable?

On Fri, Feb 5, 2010 at 1:20 PM, Javier Barroso <javibarroso@gmail.com> wrote:
> On Fri, Feb 5, 2010 at 1:06 AM, Stephen Powell <zlinuxman@wowway.com> wrote:
>> On Thu, 4 Feb 2010 17:42:45 -0500 (EST), Javier Barroso wrote:
>>> In this case output goes to stderr, so:
>>> tar -zcvf - * --exclude-from $EXCLUDES 2> /tmp/data$$ | openssl ...
>> Is that something you just have to find out by trial and error?
>> I checked the man page for tar, and there's nothing in there about
>> the -v output being written to stderr.  I'll take your word for it,
>> but in the general case, it's hard to tell.  Since stdout and
>> stderr both default to the terminal, and since the doc doesn't
>> say, how else would you know other than by trial and error?
> If you are using stdout as tar output, including filenames there will
> corrupt that output, so it is logical that in this case filenames goes
> to stderr.
> Sorry my bad english, I hope you understand my opinion

That's true: programs using stdout for data output certainly have to
use stderr as a way to report any additional info.


Reply to: