Subj : system.exec() and commands in double-quotes
To   : Digital Man
From : Nightfox
Date : Tue Apr 08 2025 08:52 pm

Hi DM,

Background: My login matrix has a feature where it can convert a .jpg etc. to a sixel using ImageMagick's conversion program.  On Windows, it's very possible that the program may be installed in a directory with a space (i.e., somewhere in C:\Program Files).  I was using a Windows test setup and making an update to my login matrix to try to allow running that with system.exec() by putting the fully-pathed executable in double-quotes.  I did some debugging, adding " & pause" to the command so I could see the command window, and it complained about "C:\Program" not existing - Even though I put double-quotes around the fully-pathed executable, it seemed to be acting like those double-quotes were removed.  I logged the command and verified the double-quotes were there.

I'm wondering if system.exec() removes double-quotes from the command it's given?

I'm also wondering if the same thing would happen on Linux (I haven't tested that).

I thought of one solution, to write the command to a batch file or shell script and run that (in a directory that doesn't contain a space), but I'm wondering if I could avoid that.

Nightfox

---
� Synchronet � Digital Distortion: digitaldistortionbbs.com