discuss@lists.openscad.org

OpenSCAD general discussion Mailing-list

View all threads

Command line version writes to stderr instead of stdout

TR
Thomas Richter
Thu, Jan 23, 2025 9:32 AM

I am running OpenSCAD 2024.12.13 on MacOS 15.1.1, M3 CPU on the command line (bash) like this:

/Applications/OpenSCAD.app/Contents/MacOS/OpenSCAD /Users/thomas/openscad/test.scad --export-format binstl --backend manifold --o /Users/thomas/openscad/output/test.stl >./out.txt 2>./err.txt

The test.scad contains just one line:

cube(20);

The stl is rendered correctly and being written to the file specified in the command options. Nonetheless, all command line output goes to err.txt instead of out.txt indicating that OpenSCAD writes to stderr instead of stdout.

Can you confirm this behavior?

Is it intended?

Is there something I miss out? Is there some error I don't see?

output written to err.txt:
Geometries in cache: 1
Geometry cache size in bytes: 848
CGAL Polyhedrons in cache: 0
CGAL cache size in bytes: 0
Total rendering time: 0:00:00.000
Top level object is a 3D object (PolySet):
Convex:      yes
Facets:        6

I am running OpenSCAD 2024.12.13 on MacOS 15.1.1, M3 CPU on the command line (bash) like this: /Applications/OpenSCAD.app/Contents/MacOS/OpenSCAD /Users/thomas/openscad/test.scad --export-format binstl --backend manifold --o /Users/thomas/openscad/output/test.stl >./out.txt 2>./err.txt The test.scad contains just one line: cube(20); The stl is rendered correctly and being written to the file specified in the command options. Nonetheless, all command line output goes to err.txt instead of out.txt indicating that OpenSCAD writes to stderr instead of stdout. Can you confirm this behavior? Is it intended? Is there something I miss out? Is there some error I don't see? output written to err.txt: Geometries in cache: 1 Geometry cache size in bytes: 848 CGAL Polyhedrons in cache: 0 CGAL cache size in bytes: 0 Total rendering time: 0:00:00.000 Top level object is a 3D object (PolySet): Convex: yes Facets: 6
TR
Thomas Richter
Thu, Jan 23, 2025 10:18 AM

After installing 2025.01.19 I can confirm that this version behaves the same. Is it the same on other OSs?

Am 23.01.2025 um 10:32 schrieb Thomas Richter tomselektropost@googlemail.com:

I am running OpenSCAD 2024.12.13 on MacOS 15.1.1, M3 CPU on the command line (bash) like this:

/Applications/OpenSCAD.app/Contents/MacOS/OpenSCAD /Users/thomas/openscad/test.scad --export-format binstl --backend manifold --o /Users/thomas/openscad/output/test.stl >./out.txt 2>./err.txt

The test.scad contains just one line:

cube(20);

The stl is rendered correctly and being written to the file specified in the command options. Nonetheless, all command line output goes to err.txt instead of out.txt indicating that OpenSCAD writes to stderr instead of stdout.

Can you confirm this behavior?

Is it intended?

Is there something I miss out? Is there some error I don't see?

output written to err.txt:
Geometries in cache: 1
Geometry cache size in bytes: 848
CGAL Polyhedrons in cache: 0
CGAL cache size in bytes: 0
Total rendering time: 0:00:00.000
Top level object is a 3D object (PolySet):
Convex:      yes
Facets:        6

After installing 2025.01.19 I can confirm that this version behaves the same. Is it the same on other OSs? > Am 23.01.2025 um 10:32 schrieb Thomas Richter <tomselektropost@googlemail.com>: > > I am running OpenSCAD 2024.12.13 on MacOS 15.1.1, M3 CPU on the command line (bash) like this: > > /Applications/OpenSCAD.app/Contents/MacOS/OpenSCAD /Users/thomas/openscad/test.scad --export-format binstl --backend manifold --o /Users/thomas/openscad/output/test.stl >./out.txt 2>./err.txt > > The test.scad contains just one line: > > cube(20); > > The stl is rendered correctly and being written to the file specified in the command options. Nonetheless, all command line output goes to err.txt instead of out.txt indicating that OpenSCAD writes to stderr instead of stdout. > > Can you confirm this behavior? > > Is it intended? > > Is there something I miss out? Is there some error I don't see? > > output written to err.txt: > Geometries in cache: 1 > Geometry cache size in bytes: 848 > CGAL Polyhedrons in cache: 0 > CGAL cache size in bytes: 0 > Total rendering time: 0:00:00.000 > Top level object is a 3D object (PolySet): > Convex: yes > Facets: 6
JB
Jordan Brown
Thu, Jan 23, 2025 4:00 PM

That’s a tough question. OpenSCAD (like many other tools) has three kinds of output, which means that there’s a mismatch with the UNIX out/err distinction.

It has errors.
It has output from the OpenSCAD program being run, from its echo() calls.
And it has … other stuff.  Progress reports, statistics, et cetera.

That last category isn’t errors, but it isn’t exactly traditional output either, and it plays poorly with tool chains that want to process the echo() output from the OpenSCAD program being run.

That’s a tough question. OpenSCAD (like many other tools) has *three* kinds of output, which means that there’s a mismatch with the UNIX out/err distinction. It has errors. It has output from the OpenSCAD program being run, from its echo() calls. And it has … other stuff. Progress reports, statistics, et cetera. That last category isn’t errors, but it isn’t exactly traditional output either, and it plays poorly with tool chains that want to process the echo() output from the OpenSCAD program being run.
JB
Jordan Brown
Thu, Jan 23, 2025 5:06 PM

Thomas points out privately that echo() output goes to stderr too.  I
had forgotten that; looking at my postprocessing scripts it seems that I
discovered that too.

It appears that the only thing that goes to stdout is output from "-o
-", allowing any of the file types (stl, png, echo, et cetera) to be
emitted.  That's actually a demonstration of why the progress reporting
/ statistic stuff should not go to stdout.

Note that you can suppress the progress reporting / statistic stuff
using -q.

Thomas points out privately that echo() output goes to stderr too.  I had forgotten that; looking at my postprocessing scripts it seems that I discovered that too. It appears that the only thing that goes to stdout is output from "-o -", allowing any of the file types (stl, png, echo, et cetera) to be emitted.  That's actually a demonstration of why the progress reporting / statistic stuff should *not* go to stdout. Note that you can suppress the progress reporting / statistic stuff using -q.
TR
Thomas Richter
Thu, Jan 23, 2025 5:12 PM

Sorry for posting private messages, I didn't realize that the reply-to address is the one of the original sender and not of the mailing list. I will consider that in future discussions.

As long as the output going to stderr is stable, I'm fine with that. I just wanted to make sure that I don't miss sth. out.

Am 23.01.2025 um 18:06 schrieb Jordan Brown openscad@jordan.maileater.net:

Thomas points out privately that echo() output goes to stderr too.  I had forgotten that; looking at my postprocessing scripts it seems that I discovered that too.

It appears that the only thing that goes to stdout is output from "-o -", allowing any of the file types (stl, png, echo, et cetera) to be emitted.  That's actually a demonstration of why the progress reporting / statistic stuff should not go to stdout.

Note that you can suppress the progress reporting / statistic stuff using -q.

Sorry for posting private messages, I didn't realize that the reply-to address is the one of the original sender and not of the mailing list. I will consider that in future discussions. As long as the output going to stderr is stable, I'm fine with that. I just wanted to make sure that I don't miss sth. out. > Am 23.01.2025 um 18:06 schrieb Jordan Brown <openscad@jordan.maileater.net>: > > Thomas points out privately that echo() output goes to stderr too. I had forgotten that; looking at my postprocessing scripts it seems that I discovered that too. > > It appears that the only thing that goes to stdout is output from "-o -", allowing any of the file types (stl, png, echo, et cetera) to be emitted. That's actually a demonstration of why the progress reporting / statistic stuff should *not* go to stdout. > > Note that you can suppress the progress reporting / statistic stuff using -q. >
RW
Rogier Wolff
Fri, Jan 24, 2025 8:59 AM

On Thu, Jan 23, 2025 at 08:00:58AM -0800, Jordan Brown via Discuss wrote:

That’s a tough question. OpenSCAD (like many other tools) has three kinds of output, which means that there’s a mismatch with the UNIX out/err distinction.

It has errors.
It has output from the OpenSCAD program being run, from its echo() calls.
And it has … other stuff.  Progress reports, statistics, et cetera.

That last category isn’t errors, but it isn’t exactly
traditional output either, and it plays poorly with tool chains that
want to process the echo() output from the OpenSCAD program being
run.

Traditional Unix programs do not produce any output or status messages.
Openscad does.

I would suggest that echo() outputs go to stdout.
and that a --quiet option suppresses all openscad status messages.
(i.e. suppresses the third stream of output).

Another, ugly solution would be to use fd 3 if it is open on
startup for one of the streams.

Roger. 

--
** R.E.Wolff@BitWizard.nl ** https://www.BitWizard.nl/ ** +31-15-2049110 **
**    Delftechpark 11 2628 XJ  Delft, The Netherlands.  KVK: 27239233    **
f equals m times a. When your f is steady, and your m is going down
your a** is going up.  -- Chris Hadfield about flying up the space shuttle.
**  'a' for accelleration.

On Thu, Jan 23, 2025 at 08:00:58AM -0800, Jordan Brown via Discuss wrote: > That’s a tough question. OpenSCAD (like many other tools) has *three* kinds of output, which means that there’s a mismatch with the UNIX out/err distinction. > > It has errors. > It has output from the OpenSCAD program being run, from its echo() calls. > And it has … other stuff. Progress reports, statistics, et cetera. > > That last category isn’t errors, but it isn’t exactly > traditional output either, and it plays poorly with tool chains that > want to process the echo() output from the OpenSCAD program being > run. Traditional Unix programs do not produce any output or status messages. Openscad does. I would suggest that echo() outputs go to stdout. and that a --quiet option suppresses all openscad status messages. (i.e. suppresses the third stream of output). Another, ugly solution would be to use fd 3 if it is open on startup for one of the streams. Roger. -- ** R.E.Wolff@BitWizard.nl ** https://www.BitWizard.nl/ ** +31-15-2049110 ** ** Delftechpark 11 2628 XJ Delft, The Netherlands. KVK: 27239233 ** f equals m times a. When your f is steady, and your m is going down your a** is going up. -- Chris Hadfield about flying up the space shuttle. ** 'a' for accelleration.
TR
Thomas Richter
Fri, Jan 24, 2025 11:20 AM

Actually most - if not all - command line UNIX programs can produce output, at least if they have something like verbose mode (cp, rm, ...). I thought about the issue this morning and came to a few insights:

If OpenSCAD needs to have the option to send rendering results (stl, png, ...) to stdout, it can send neither statistics nor echo()-output to stdout in order not to contaminate the rendering result. My guess is that the feature exists to be able to pipe the rendering results(?)

If the issue should be solved (again: I am fine with stderr as long as it can be considered stable behavior) I see the following possibilities:

  1. rendering to stdout shall remain unchanged AND all non-erroneous output shall be sent to stdout: send all non-erroneous output to stdout AND automatically switch to quiet-mode if rendering results are to be sent to stdout

  2. rendering to stdout shall remain unchanged AND all non-erroneous output shall not be sent to stderr: send rendering results to stdout AND send all non-erroneous output to a file

  3. rendering to stdout can be skipped: remove the functionality and send all non-erroneous output to stdout. I have no idea how popular the feature is.

I think that #2 is not a preferable option.

Solving this issue would help to recognize erroneous rendering because rendering errors and warnings could be sent to stderr and analysed appropriately.

Am 24.01.2025 um 09:59 schrieb Rogier Wolff via Discuss discuss@lists.openscad.org:

On Thu, Jan 23, 2025 at 08:00:58AM -0800, Jordan Brown via Discuss wrote:

That’s a tough question. OpenSCAD (like many other tools) has three kinds of output, which means that there’s a mismatch with the UNIX out/err distinction.

It has errors.
It has output from the OpenSCAD program being run, from its echo() calls.
And it has … other stuff.  Progress reports, statistics, et cetera.

That last category isn’t errors, but it isn’t exactly
traditional output either, and it plays poorly with tool chains that
want to process the echo() output from the OpenSCAD program being
run.

Traditional Unix programs do not produce any output or status messages.
Openscad does.

I would suggest that echo() outputs go to stdout.
and that a --quiet option suppresses all openscad status messages.
(i.e. suppresses the third stream of output).

Another, ugly solution would be to use fd 3 if it is open on
startup for one of the streams.

Roger.

--
** R.E.Wolff@BitWizard.nl ** https://www.BitWizard.nl/ ** +31-15-2049110 **
**    Delftechpark 11 2628 XJ  Delft, The Netherlands.  KVK: 27239233    **
f equals m times a. When your f is steady, and your m is going down
your a** is going up.  -- Chris Hadfield about flying up the space shuttle.
**  'a' for accelleration.


OpenSCAD mailing list
To unsubscribe send an email to discuss-leave@lists.openscad.org

Actually most - if not all - command line UNIX programs _can_ produce output, at least if they have something like verbose mode (cp, rm, ...). I thought about the issue this morning and came to a few insights: If OpenSCAD needs to have the option to send rendering results (stl, png, ...) to stdout, it can send neither statistics nor echo()-output to stdout in order not to contaminate the rendering result. My guess is that the feature exists to be able to pipe the rendering results(?) If the issue should be solved (again: I am fine with stderr as long as it can be considered stable behavior) I see the following possibilities: 1) rendering to stdout shall remain unchanged AND all non-erroneous output shall be sent to stdout: send all non-erroneous output to stdout AND automatically switch to quiet-mode if rendering results are to be sent to stdout 2) rendering to stdout shall remain unchanged AND all non-erroneous output shall not be sent to stderr: send rendering results to stdout AND send all non-erroneous output to a file 3) rendering to stdout can be skipped: remove the functionality and send all non-erroneous output to stdout. I have no idea how popular the feature is. I think that #2 is not a preferable option. Solving this issue would help to recognize erroneous rendering because rendering errors and warnings could be sent to stderr and analysed appropriately. > Am 24.01.2025 um 09:59 schrieb Rogier Wolff via Discuss <discuss@lists.openscad.org>: > > On Thu, Jan 23, 2025 at 08:00:58AM -0800, Jordan Brown via Discuss wrote: >> That’s a tough question. OpenSCAD (like many other tools) has *three* kinds of output, which means that there’s a mismatch with the UNIX out/err distinction. >> >> It has errors. >> It has output from the OpenSCAD program being run, from its echo() calls. >> And it has … other stuff. Progress reports, statistics, et cetera. >> > >> That last category isn’t errors, but it isn’t exactly >> traditional output either, and it plays poorly with tool chains that >> want to process the echo() output from the OpenSCAD program being >> run. > > Traditional Unix programs do not produce any output or status messages. > Openscad does. > > I would suggest that echo() outputs go to stdout. > and that a --quiet option suppresses all openscad status messages. > (i.e. suppresses the third stream of output). > > Another, ugly solution would be to use fd 3 if it is open on > startup for one of the streams. > > Roger. > > -- > ** R.E.Wolff@BitWizard.nl ** https://www.BitWizard.nl/ ** +31-15-2049110 ** > ** Delftechpark 11 2628 XJ Delft, The Netherlands. KVK: 27239233 ** > f equals m times a. When your f is steady, and your m is going down > your a** is going up. -- Chris Hadfield about flying up the space shuttle. > ** 'a' for accelleration. > _______________________________________________ > OpenSCAD mailing list > To unsubscribe send an email to discuss-leave@lists.openscad.org
GB
Glenn Butcher
Fri, Jan 24, 2025 11:38 AM

I've recently written command-line programs that required both
information/status and "render" output, and I simply directed the former
to stderr.  Since both direct to the console by default, the average
user doesn't even notice the difference.  And, IMHO the average advanced
user should know how to deal with it.

I use OpenSCAD as a command-line rendering engine for a web-page
front-end for the customizer; I don't currently pipe render output to
stdout but I can see the use-case, where OpenSCAD render output would go
to another program for further manipulation, e.g., mesh-fixing.  Some
might utter "WebAssembly" and such, sorry, might not want to burden a
user's browser with all that.

Anyway, a bit of food-for-thought...

Glenn Butcher

On 1/24/2025 8:20 AM, Thomas Richter via Discuss wrote:

Actually most - if not all - command line UNIX programs can produce output, at least if they have something like verbose mode (cp, rm, ...). I thought about the issue this morning and came to a few insights:

If OpenSCAD needs to have the option to send rendering results (stl, png, ...) to stdout, it can send neither statistics nor echo()-output to stdout in order not to contaminate the rendering result. My guess is that the feature exists to be able to pipe the rendering results(?)

If the issue should be solved (again: I am fine with stderr as long as it can be considered stable behavior) I see the following possibilities:

  1. rendering to stdout shall remain unchanged AND all non-erroneous output shall be sent to stdout: send all non-erroneous output to stdout AND automatically switch to quiet-mode if rendering results are to be sent to stdout

  2. rendering to stdout shall remain unchanged AND all non-erroneous output shall not be sent to stderr: send rendering results to stdout AND send all non-erroneous output to a file

  3. rendering to stdout can be skipped: remove the functionality and send all non-erroneous output to stdout. I have no idea how popular the feature is.

I think that #2 is not a preferable option.

Solving this issue would help to recognize erroneous rendering because rendering errors and warnings could be sent to stderr and analysed appropriately.

Am 24.01.2025 um 09:59 schrieb Rogier Wolff via Discuss discuss@lists.openscad.org:

On Thu, Jan 23, 2025 at 08:00:58AM -0800, Jordan Brown via Discuss wrote:

That’s a tough question. OpenSCAD (like many other tools) has three kinds of output, which means that there’s a mismatch with the UNIX out/err distinction.

It has errors.
It has output from the OpenSCAD program being run, from its echo() calls.
And it has … other stuff.  Progress reports, statistics, et cetera.

That last category isn’t errors, but it isn’t exactly
traditional output either, and it plays poorly with tool chains that
want to process the echo() output from the OpenSCAD program being
run.
Traditional Unix programs do not produce any output or status messages.
Openscad does.

I would suggest that echo() outputs go to stdout.
and that a --quiet option suppresses all openscad status messages.
(i.e. suppresses the third stream of output).

Another, ugly solution would be to use fd 3 if it is open on
startup for one of the streams.

Roger.

--
** R.E.Wolff@BitWizard.nl ** https://www.BitWizard.nl/ ** +31-15-2049110 **
**    Delftechpark 11 2628 XJ  Delft, The Netherlands.  KVK: 27239233    **
f equals m times a. When your f is steady, and your m is going down
your a** is going up.  -- Chris Hadfield about flying up the space shuttle.
**  'a' for accelleration.


OpenSCAD mailing list
To unsubscribe send an email to discuss-leave@lists.openscad.org


OpenSCAD mailing list
To unsubscribe send an email to discuss-leave@lists.openscad.org

I've recently written command-line programs that required both information/status and "render" output, and I simply directed the former to stderr.  Since both direct to the console by default, the average user doesn't even notice the difference.  And, IMHO the average advanced user should know how to deal with it. I use OpenSCAD as a command-line rendering engine for a web-page front-end for the customizer; I don't currently pipe render output to stdout but I can see the use-case, where OpenSCAD render output would go to another program for further manipulation, e.g., mesh-fixing.  Some might utter "WebAssembly" and such, sorry, might not want to burden a user's browser with all that. Anyway, a bit of food-for-thought... Glenn Butcher On 1/24/2025 8:20 AM, Thomas Richter via Discuss wrote: > Actually most - if not all - command line UNIX programs _can_ produce output, at least if they have something like verbose mode (cp, rm, ...). I thought about the issue this morning and came to a few insights: > > If OpenSCAD needs to have the option to send rendering results (stl, png, ...) to stdout, it can send neither statistics nor echo()-output to stdout in order not to contaminate the rendering result. My guess is that the feature exists to be able to pipe the rendering results(?) > > If the issue should be solved (again: I am fine with stderr as long as it can be considered stable behavior) I see the following possibilities: > > 1) rendering to stdout shall remain unchanged AND all non-erroneous output shall be sent to stdout: send all non-erroneous output to stdout AND automatically switch to quiet-mode if rendering results are to be sent to stdout > > 2) rendering to stdout shall remain unchanged AND all non-erroneous output shall not be sent to stderr: send rendering results to stdout AND send all non-erroneous output to a file > > 3) rendering to stdout can be skipped: remove the functionality and send all non-erroneous output to stdout. I have no idea how popular the feature is. > > I think that #2 is not a preferable option. > > Solving this issue would help to recognize erroneous rendering because rendering errors and warnings could be sent to stderr and analysed appropriately. > >> Am 24.01.2025 um 09:59 schrieb Rogier Wolff via Discuss <discuss@lists.openscad.org>: >> >> On Thu, Jan 23, 2025 at 08:00:58AM -0800, Jordan Brown via Discuss wrote: >>> That’s a tough question. OpenSCAD (like many other tools) has *three* kinds of output, which means that there’s a mismatch with the UNIX out/err distinction. >>> >>> It has errors. >>> It has output from the OpenSCAD program being run, from its echo() calls. >>> And it has … other stuff. Progress reports, statistics, et cetera. >>> >>> That last category isn’t errors, but it isn’t exactly >>> traditional output either, and it plays poorly with tool chains that >>> want to process the echo() output from the OpenSCAD program being >>> run. >> Traditional Unix programs do not produce any output or status messages. >> Openscad does. >> >> I would suggest that echo() outputs go to stdout. >> and that a --quiet option suppresses all openscad status messages. >> (i.e. suppresses the third stream of output). >> >> Another, ugly solution would be to use fd 3 if it is open on >> startup for one of the streams. >> >> Roger. >> >> -- >> ** R.E.Wolff@BitWizard.nl ** https://www.BitWizard.nl/ ** +31-15-2049110 ** >> ** Delftechpark 11 2628 XJ Delft, The Netherlands. KVK: 27239233 ** >> f equals m times a. When your f is steady, and your m is going down >> your a** is going up. -- Chris Hadfield about flying up the space shuttle. >> ** 'a' for accelleration. >> _______________________________________________ >> OpenSCAD mailing list >> To unsubscribe send an email to discuss-leave@lists.openscad.org > _______________________________________________ > OpenSCAD mailing list > To unsubscribe send an email to discuss-leave@lists.openscad.org
JB
Jordan Brown
Sat, Jan 25, 2025 12:01 AM

On 1/24/2025 12:59 AM, Rogier Wolff via Discuss wrote:

Traditional Unix programs do not produce any output or status messages.

tar with the "v" option has always produced status output.  (Similarly,
though not quite as old, cpio.)

dd has always reported the number of blocks written.

make reports commands as it executes them.  (Though that is arguably
"output".)

sh -x reports commands as it executes them.

Those are the ones that I find in a quick scan through my V7 manual,
considering only those that also write output to stdout and are not
clearly intended for human interaction.  More recent tools are likely to
do more, take longer, and so be more likely to produce progress
reporting.  (But, alas, they are also less likely to use stdin and stdout.)

It's not so many as to have been an obvious need on day one, but it's
also not so few that they can be ignored.

and that a --quiet option suppresses all openscad status messages.

It does.

Another, ugly solution would be to use fd 3 if it is open on
startup for one of the streams.

Not safe.  Programs invoking other programs are not required to close
all of their open files.  (They probably should, but they aren't
required to.)

On 1/24/2025 12:59 AM, Rogier Wolff via Discuss wrote: > Traditional Unix programs do not produce any output or status messages. tar with the "v" option has always produced status output.  (Similarly, though not *quite* as old, cpio.) dd has always reported the number of blocks written. make reports commands as it executes them.  (Though that is arguably "output".) sh -x reports commands as it executes them. Those are the ones that I find in a quick scan through my V7 manual, considering only those that also write output to stdout and are not clearly intended for human interaction.  More recent tools are likely to do more, take longer, and so be more likely to produce progress reporting.  (But, alas, they are also less likely to use stdin and stdout.) It's not so many as to have been an obvious need on day one, but it's also not so few that they can be ignored. > and that a --quiet option suppresses all openscad status messages. It does. > Another, ugly solution would be to use fd 3 if it is open on > startup for one of the streams. Not safe.  Programs invoking other programs are not required to close all of their open files.  (They probably *should*, but they aren't required to.)
RW
Rogier Wolff
Sat, Jan 25, 2025 3:48 PM

On Fri, Jan 24, 2025 at 04:01:26PM -0800, Jordan Brown wrote:

On 1/24/2025 12:59 AM, Rogier Wolff via Discuss wrote:

Traditional Unix programs do not produce any output or status messages.

tar with the "v" option has always produced status output.  (Similarly,
though not quite as old, cpio.)

dd has always reported the number of blocks written.

make reports commands as it executes them.  (Though that is arguably
"output".)

sh -x reports commands as it executes them.

What I meant is that generally say a "sort" program won't
report: "reading input", "sorting", "writing results".

Many oldfashioned unix programs adhere to this principle, and some
don't. e.g. when you start passing arguments (sh -x) they can be
persuaded to indeed tell what they are doing. Usually on stderr is my
guess. I checked sh and indeed the -x output is on stderr, as to not
polute the actual output on stdout.

Openscad behaves contrary to this IMHO not a problem, but it does
create a few problems.

dd is a program that violates the Unix philosphy. It is the exception
to the rule. Modern Posix rules are pushing it to become even more
unusable. I remember an instance about a decade ago where I found dd's
behaviour undesirable and in the end the dd guys said: "Posix
specifies this behaviour, our hands are tied".

Not safe.  Programs invoking other programs are not required to close
all of their open files.  (They probably should, but they aren't
required to.)

In that case this needs to be guarded by say a "--fd=12" option for
stuff to appear on open file descriptor nr 12...

Roger. 

--
** R.E.Wolff@BitWizard.nl ** https://www.BitWizard.nl/ ** +31-15-2049110 **
**    Delftechpark 11 2628 XJ  Delft, The Netherlands.  KVK: 27239233    **
f equals m times a. When your f is steady, and your m is going down
your a** is going up.  -- Chris Hadfield about flying up the space shuttle.
**  'a' for accelleration.

On Fri, Jan 24, 2025 at 04:01:26PM -0800, Jordan Brown wrote: > On 1/24/2025 12:59 AM, Rogier Wolff via Discuss wrote: > > Traditional Unix programs do not produce any output or status messages. > > tar with the "v" option has always produced status output.  (Similarly, > though not *quite* as old, cpio.) > > dd has always reported the number of blocks written. > > make reports commands as it executes them.  (Though that is arguably > "output".) > > sh -x reports commands as it executes them. What I meant is that generally say a "sort" program won't report: "reading input", "sorting", "writing results". Many oldfashioned unix programs adhere to this principle, and some don't. e.g. when you start passing arguments (sh -x) they can be persuaded to indeed tell what they are doing. Usually on stderr is my guess. I checked sh and indeed the -x output is on stderr, as to not polute the actual output on stdout. Openscad behaves contrary to this IMHO not a problem, but it does create a few problems. dd is a program that violates the Unix philosphy. It is the exception to the rule. Modern Posix rules are pushing it to become even more unusable. I remember an instance about a decade ago where I found dd's behaviour undesirable and in the end the dd guys said: "Posix specifies this behaviour, our hands are tied". > Not safe.  Programs invoking other programs are not required to close > all of their open files.  (They probably *should*, but they aren't > required to.) In that case this needs to be guarded by say a "--fd=12" option for stuff to appear on open file descriptor nr 12... Roger. -- ** R.E.Wolff@BitWizard.nl ** https://www.BitWizard.nl/ ** +31-15-2049110 ** ** Delftechpark 11 2628 XJ Delft, The Netherlands. KVK: 27239233 ** f equals m times a. When your f is steady, and your m is going down your a** is going up. -- Chris Hadfield about flying up the space shuttle. ** 'a' for accelleration.