[prev in list] [next in list] [prev in thread] [next in thread] 

List:       busybox
Subject:    Re: Redirection of stdout for commands
From:       sleepy_dog () gmx ! de
Date:       2021-10-08 15:02:59
Message-ID: 19602fc2-8f81-5c5c-37aa-0b328a049059 () gmx ! de
[Download RAW message or body]



Denys Vlasenko wrote:
 > [busybox] dd --help prints to stderr.

D'oh! Lol, thanks!
Any particular reason for this choice? It seems unintuitive to me to put
normal output on an error stream, I guess separation of busybox itself
and commands was wanted for some reason?



> On Fri, Oct 8, 2021 at 4:15 PM <sleepy_dog@gmx.de> wrote:
>> Hello there,
>>
>> 1st time post here.
>>
>> On a BusyBox based system (image built recently) I have a program
>> calling external executables and reading their text output.
>> This is done with fork, execl, and beforehand, redirecting the output
>> with dup2, quite like here:
>> https://dzone.com/articles/simple-popen2-implementation
>>
>> This generally works. There is one oddity, when calling Linux commands
>> with this method:
>>
>> Depending on whether I run that same program on a regular distribution
>> Linux machine, or on BusyBox, I get different results.
>> It works as expected on e.g. Ubuntu.
>> On BusyBox, it's different:
>> - if I call only BusyBox with "busybox --help", rhings work as expected,
>> e.g. nothing spills to the console, and I read all the input vie my
>> redirected stdout
> busybox --help prints to stdout.
>
>> - if I call a command handle by busybox, e.g. "dd --help", I get back
>> nothing from stdout, and all text output spills directly on the console
>> - if I call busybox explicitly, with the command added, like "busybox dd
>> --help", it's the same as previous, i.e. doesn't work
> [busybox] dd --help prints to stderr.
>

_______________________________________________
busybox mailing list
busybox@busybox.net
http://lists.busybox.net/mailman/listinfo/busybox
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic