Amiga.org

Amiga computer related discussion => General chat about Amiga topics => Topic started by: doctorq on February 11, 2025, 04:50:50 PM

Title: AmigaGuide - any experts on the SYSTEM link node?
Post by: doctorq on February 11, 2025, 04:50:50 PM
I'm making an AmigaGuide format where I need to execute a command with a parameter with a space in it.

In the AmigaGuide 101 found here https://wiki.amigaos.net/wiki/AmigaGuide_101 the example is

@{"Picture of a Workbench Screen" SYSTEM sys:utilities/Display sys:Workbench.pic}

What to do if my filename is This is my workbench.pic?
Title: Re: AmigaGuide - any experts on the SYSTEM link node?
Post by: polyp2000 on February 11, 2025, 09:13:23 PM
just a informed guess , but put the image filename & path in quotes, like the text description with spaces at the beginning.
Title: Re: AmigaGuide - any experts on the SYSTEM link node?
Post by: doctorq on February 11, 2025, 10:15:21 PM
Thanks for the suggestion, but unfortunately no dice  :(
Title: Re: AmigaGuide - any experts on the SYSTEM link node?
Post by: doctorq on February 11, 2025, 10:18:53 PM
For those interested, I seem to have found the solution myself...

Code: [Select]
@{"Picture of a Workbench Screen" SYSTEM "sys:utilities/Display \"sys:This is my Workbench.pic\""}
seems to do the trick for me.
Title: Re: AmigaGuide - any experts on the SYSTEM link node?
Post by: nbache on February 11, 2025, 10:24:14 PM
Out of interest, does the former version work? I.e. are the double quotes around the whole argument to SYSTEM only necessary if the pathname given as argument to the displayer has spaces? If so, it smells strangely like a bug. And if not, it smells more like an error in the Wiki.

Either way, I'd like to know.

Best regards,

Niels
Title: Re: AmigaGuide - any experts on the SYSTEM link node?
Post by: doctorq on February 11, 2025, 11:11:58 PM
I will try and test tomorrow, but in my test file I actually set the double quotation marks after SYSTEM right away, so I don't know for sure. I'm guessing an error in the docs though.
Title: Re: AmigaGuide - any experts on the SYSTEM link node?
Post by: nbache on February 11, 2025, 11:55:11 PM
Yeah, once those outer quotes are set, it makes good sense that quotes inside those have to be escaped.

So I'd also guess that it's a doc error - but look forward to hearing your test result.

(I could theoretically set up a test case myself, but it sounds like you already have a good one ready  ;)).

Best regards,

Niels
Title: Re: AmigaGuide - any experts on the SYSTEM link node?
Post by: doctorq on February 12, 2025, 07:50:22 AM
I have tested today, and if you write the line as it is in the docs, it will only launch the Display utility and not parse the image filename to the utility. Putting double quotes around the whole command will execute the command properly, thus parsing the image filename to the utility. When using spaces in the filename, you will have to do as I posted earlier, so

Code: [Select]
@{"Picture of a Workbench Screen" SYSTEM "sys:utilities/Display \"sys:This is my Workbench.pic\""}
Testing was done on real hardware with OS3.9. Multiview version 45.9 (2002/01/18)
Title: Re: AmigaGuide - any experts on the SYSTEM link node?
Post by: Minuous on February 12, 2025, 10:07:18 AM
I have fixed the example at the wiki; unfortunately there is no way to fix the original Amiga Mail article :-(
Title: Re: AmigaGuide - any experts on the SYSTEM link node?
Post by: nbache on February 12, 2025, 10:42:21 AM
Thanks, both of you.

Now it makes sense :-).

Best regards,

Niels