Page 1 of 1

runprogram() question

Posted: Sat Sep 30, 2023 6:19 pm
by dmontaine
Why does this program not work in Linux?

Result = RunProgram("/usr/bin/xterm","-help","~")
Debug(Result)

Result shows 1 however terminal window does not appear

However, this program without parameters does work.

Result = RunProgram("/usr/bin/xterm")
Debug(Result)

Testing with Linux Mint LMDE 6

Re: runprogram() question

Posted: Sat Sep 30, 2023 8:44 pm
by jassing
dmontaine wrote: Sat Sep 30, 2023 6:19 pm Why does this program not work in Linux?

Result = RunProgram("/usr/bin/xterm","-help","~")
Debug(Result)

Result shows 1 however terminal window does not appear

However, this program without parameters does work.

Result = RunProgram("/usr/bin/xterm")
Debug(Result)

Testing with Linux Mint LMDE 6
I'm not a linux user... so this is just a guess.

for the "-help" version, xterm runs and exits. so the program has run and exited.
You need to use the constants for reading stdout.

For the "xterm" only (no -help) it launches the program and waits for it to finish.

Re: runprogram() question

Posted: Sat Sep 30, 2023 10:08 pm
by infratec
Yes,

if you want to capture text output you need the additional Flags for RunProgram() and read the values.

Re: runprogram() question

Posted: Sun Oct 01, 2023 7:48 am
by Marc56us
dmontaine wrote: Sat Sep 30, 2023 6:19 pm Why does this program not work in Linux?

Result = RunProgram("/usr/bin/xterm","-help","~")
Debug(Result)

Result shows 1 however terminal window does not appear

However, this program without parameters does work.

Result = RunProgram("/usr/bin/xterm")
Debug(Result)

Testing with Linux Mint LMDE 6
It probably appears but closes so quickly that you don't have time to see it.
If the help displayed is less than one screen page long, then the default pager ("more" or "less") (if set) is not called and the program is terminated, so the shell window (xterm) closes.
Try use #PB_Program_Wait : Wait until the launched program quits

Re: runprogram() question

Posted: Mon Oct 02, 2023 9:01 am
by juergenkulow
Compiler Executable

Code: Select all

RunProgram("/usr/bin/xterm","-help","~")
Terminal or xterm:

Code: Select all

kulow@kulow-G73Jw:/tmp$ ./xhelp.out
kulow@kulow-G73Jw:/tmp$ XTerm(372) usage:
    xterm [-options ...] [-e command args]

where options include:
    -/+132                       turn on/off 80/132 column switching
    -C                           intercept console messages
    -Sccn                        slave mode on "ttycc", file descriptor "n"
    -T string                    title name for window
...