[fpc-pascal] Why does RunCommand not produce the correct output?

Bo Berglund bo.berglund at gmail.com
Mon May 1 23:38:56 CEST 2023


On Mon, 1 May 2023 14:25:28 -0400, Travis Siegel via fpc-pascal
<fpc-pascal at lists.freepascal.org> wrote:

>You could just add the line:
>
>#!/bin/bash
>
>to the first line of your script, then just call the script from your 
>program.
>
>Alternatively, you could call the bash command, and pass the command to 
>it that way, either one should get you the output you desire.

I did already create a script "listserial" that does the extraction:
(long line split by newsreader)

-----------------------------
#!/bin/bash
SERLIST=$(ls -l /sys/class/tty/*/device/driver | grep -v
"platform/drivers/serial8250" | awk '{print $9}' | awk -F'/' '{print "/dev/"
$5}')
echo $SERLIST
-----------------------------

This successfully lists the available serial ports by their device name, which
can be used to open the port using the built-in serial unit functionality.

Of course I *could* call the script from the program but I wanted it all be
within the FPC program itself...

But it can be done by calling the standalone script file of course...


-- 
Bo Berglund
Developer in Sweden



More information about the fpc-pascal mailing list