There are, I think, three levels of quoting in play.
I have never really used PowerShell, so I'm only stabbing in the dark,
but this incantation appears to work:
-D 'variable=\"string\"'
That is:
I believe that:
If you need to get a backslash or a double quote into the OpenSCAD
variable, it will be ... more complicated. Buy lots of extra backslashes.
So, for a complete command, assuming that OpenSCAD is in your path, with
an x.scad that consists of "echo(variable);":
openscad -D 'variable=\"string\"' -o x.stl x.scad
Come to think of it, if you want to get spaces into the OpenSCAD value,
that too will require some care. So far, I haven't found the right
incantation. PowerShell quoting rules seem ... somewhat opaque. (And
yes, I've RTFM, at least the appropriate-looking parts of TFM, and they
don't seem to cover the precise areas that I need. PowerShell seems to
try to be helpful and add quoting that it thinks that you need, and
nested quoting is hard enough without help like that.)
I've looked at PowerShell a few times over the years. It's got some
really cool concepts, but it was always just a bit too different from
what I was used to (CMD and UNIX shell), and so I never really dug into
it. I'd always assumed that if I dug into it, it would all make sense.
Today, I'm not so sure.
Another approach is to grab some UNIX-under-Windows environment like
MSYS2, and run your scripts there where you have bash. Nested quoting
is still not fun, but it seems easier to understand. I have run into a
couple of weird command-line behaviors, but they have been much further
off the beaten track than this stuff.
Who’d a thunk the old “MS-DOS” command shell would work better (at least easier) than the
new stuff? Yeah, I’m drifting into the “not a fan” club re PowerShell.
Only reason I was using it was that’s what gets called up when you use the ‘Open in Terminal”
context menu entry in Explorer. For some reason I went that way instead of the CMD shortcut
I keep on the taskbar.
From: Jordan Brown via Discuss discuss@lists.openscad.org
Sent: Wednesday, December 10, 2025 11:03 PM
To: OpenSCAD general discussion Mailing-list discuss@lists.openscad.org
Cc: Jordan Brown openscad@jordan.maileater.net
Subject: [OpenSCAD] Re: Input parameters to OpenSCAD in CLI
Come to think of it, if you want to get spaces into the OpenSCAD value, that too will require some care. So far, I haven't found the right incantation. PowerShell quoting rules seem ... somewhat opaque. (And yes, I've RTFM, at least the appropriate-looking parts of TFM, and they don't seem to cover the precise areas that I need. PowerShell seems to try to be helpful and add quoting that it thinks that you need, and nested quoting is hard enough without help like that.)
I've looked at PowerShell a few times over the years. It's got some really cool concepts, but it was always just a bit too different from what I was used to (CMD and UNIX shell), and so I never really dug into it. I'd always assumed that if I dug into it, it would all make sense. Today, I'm not so sure.
Another approach is to grab some UNIX-under-Windows environment like MSYS2, and run your scripts there where you have bash. Nested quoting is still not fun, but it seems easier to understand. I have run into a couple of weird command-line behaviors, but they have been much further off the beaten track than this stuff.
On 12/10/2025 11:17 PM, Lee DeRaud via Discuss wrote:
Who’d a thunk the old “MS-DOS” command shell would work better (at
least easier) than the
new stuff?
Simple and stupid is stupid, but it's also simple.
It has been awhile since I have done this, but git has a way to check out
files from a specific date. This would likely be a good way to set up
version tags that are just date stamps of when people think it was stable
enough to tag.
On Wed, Dec 10, 2025 at 5:40 AM nop head via Discuss <
discuss@lists.openscad.org> wrote:
NopScadLib uses semantic versioning and every push I do has a new version
tag. Obviously doesn't work with forks though but it does make it clear
what sort of changes have been made.
On Wed, 10 Dec 2025, 01:53 Jordan Brown via Discuss, <
discuss@lists.openscad.org> wrote:
On 12/9/2025 4:06 PM, jon jonbondy.com wrote:
That discussion puts versioning of major operating systems into perspective!
Operating system versioning is hard, especially because it interacts with
marketing. (Major versions are good because they show that you are
innovative and doing big stuff. Major versions are bad because nobody
trusts compatibility across major versions and so it's hard to get people
to adopt them.)
But versioning a distributed project makes that look easy. (And,
speaking as somebody in OS development... we have those problems too,
internally. In my org, the major way we keep the versioning complexity
sort of under control is that, other than external releases, the only thing
that matters is the mainline build number. Nothing that happens in a
developer's repo or a team's local repo has any sort of formal versioning,
other than a name and a timestamp.)
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
It will also allow people to go back and say "it was working for me as of
<this> date"
On Thu, Dec 11, 2025 at 5:06 AM John David ebo.2112@gmail.com wrote:
It has been awhile since I have done this, but git has a way to check out
files from a specific date. This would likely be a good way to set up
version tags that are just date stamps of when people think it was stable
enough to tag.
On Wed, Dec 10, 2025 at 5:40 AM nop head via Discuss <
discuss@lists.openscad.org> wrote:
NopScadLib uses semantic versioning and every push I do has a new version
tag. Obviously doesn't work with forks though but it does make it clear
what sort of changes have been made.
On Wed, 10 Dec 2025, 01:53 Jordan Brown via Discuss, <
discuss@lists.openscad.org> wrote:
On 12/9/2025 4:06 PM, jon jonbondy.com wrote:
That discussion puts versioning of major operating systems into perspective!
Operating system versioning is hard, especially because it interacts
with marketing. (Major versions are good because they show that you are
innovative and doing big stuff. Major versions are bad because nobody
trusts compatibility across major versions and so it's hard to get people
to adopt them.)
But versioning a distributed project makes that look easy. (And,
speaking as somebody in OS development... we have those problems too,
internally. In my org, the major way we keep the versioning complexity
sort of under control is that, other than external releases, the only thing
that matters is the mainline build number. Nothing that happens in a
developer's repo or a team's local repo has any sort of formal versioning,
other than a name and a timestamp.)
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
+1 for MSYS2
I keep a complete MSY2 development environment on my Windows Surface 7
tablet. bash lets me do just about everything I do on my Linux desktop,
'cept for the GPU-intensive things, and that's not a OS problem.
Recently, I briefly considered PowerShell for a deployment problem; I
ended up just glomming together the three separate command-line programs
into one c++ 'franken-program':
https://github.com/butcherg/stonewall
Incorporates the OpenCV, libnoise, and Manifold libraries, and I wrote
it using Windows Notepad++ and MSY2 gcc. Seemed easier to do than
figure out PowerShell... :D
Glenn
On 12/11/2025 12:02 AM, Jordan Brown via Discuss wrote:
Come to think of it, if you want to get spaces into the OpenSCAD
value, that too will require some care. So far, I haven't found the
right incantation. PowerShell quoting rules seem ... somewhat
opaque. (And yes, I've RTFM, at least the appropriate-looking parts
of TFM, and they don't seem to cover the precise areas that I need.
PowerShell seems to try to be helpful and add quoting that it thinks
that you need, and nested quoting is hard enough without help like that.)
I've looked at PowerShell a few times over the years. It's got some
really cool concepts, but it was always just a bit too different from
what I was used to (CMD and UNIX shell), and so I never really dug
into it. I'd always assumed that if I dug into it, it would all make
sense. Today, I'm not so sure.
Another approach is to grab some UNIX-under-Windows environment like
MSYS2, and run your scripts there where you have bash. Nested quoting
is still not fun, but it seems easier to understand. I have run into
a couple of weird command-line behaviors, but they have been much
further off the beaten track than this stuff.
OpenSCAD mailing list
To unsubscribe send an email to discuss-leave@lists.openscad.org