When I have a program like this:
program test;
{$mode objfpc}
var i: integer;
begin
writeln('CmdLine=', system.CmdLine);
writeln('paramCount=', paramCount);
for i:=1 to paramCount do
writeln('paramStr(', i, ')=', paramStr(i));
end.
and start it on Windows with 'a * b' as command line parameters, then my program shows:
D:\FPC\work\>test.exe a * b
CmdLine=test.exe a * b
paramCount=3
paramStr(1)=a
paramStr(2)=*
paramStr(3)=b
But when I start this program and command line parameters on Linux, then my program inserts all folders and files of the current folder:
hartmut@i3300:~$ test a * b
CmdLine=test a core Downloads examples.desktop Inst snap tmp b
paramCount=8
paramStr(1)=a
paramStr(2)=core
paramStr(3)=Downloads
paramStr(4)=examples.desktop
paramStr(5)=Inst
paramStr(6)=snap
paramStr(7)=tmp
paramStr(8)=b
I want to convert a couple of older console programs from Windows to Linux. Therefore I need access to the original commandline, where all characters and combinations are unchanged.
Is this possible and how? And is the asterisk the only character, which is expandend automatically, or are there more?
I'm an absolute beginner on Linux. I have FPC 3.0.4 on Ubuntu 18.04. Thanks in advance.