On November 26, 2020 10:23:33 AM GMT+01:00, Stuart Henderson
<s...@spacehopper.org> wrote:
>On 2020/11/25 23:56, Alexander Hall wrote:
>>
>>
>> On November 25, 2020 11:09:02 PM GMT+01:00, Stuart Henderson
><s...@spacehopper.org> wrote:
>> >On 2020-11-25, Manuel Giraud <man...@ledu-giraud.fr> wrote:
>> >> I have one (somewhat) related question left: is possible to
>capture
>> >the
>> >> output of pkg_delete -an in a file? I tried the following (without
>> >> luck):
>> >> $ pkg_delete -an > /tmp/foo
>> >
>> >Here you redirect stdout from the process to /tmp/foo
>> >
>> >> $ pkg_delete -an > /tmp/foo 2>&1
>> >
>> >And here you redirect stdout from the process to /tmp/foo, and then
>> >stderr to stdout.
>> >
>> >What you need is:
>> >
>> > $ pkg_delete -an 2>&1 > /tmp/foo
>> >
>> >- redirect stderr to stdout, then redirect stdout (which now
>includes
>> >stderr) to /tmp/foo.
>>
>> I think you're wrong. I hope I'm not.
>
>Ah yes, you are right, I had it exactly the wrong way round.
There's no doubt in my mind you do know these things. :-)
What you described would apply if there was a pipe in between though, so that
could be how you fooled yourself;
$ pkg_delete -an 2>&1 | cat > /tmp/foo
/Alexander