Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / lazarus / 2023-03

runcommand doesn't work?

3 messages · 3 people ·

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

john Ward

I have a program, segment included below, that partially works. The first 'runcommand' example works, but the 2nd doesn't?

If I type the lp command line, it prints perfectly..

 if RunCommand('unix2dos', ['-n', '-f', '/mbs/mbs/file/cust.f','/mbs/mbs/file/cust.frm'],s) then
 writeln(s);
  if RunCommand('/bin/lp', ['-d', ' printer1','-o=raw' ,'/mbs/mbs/file/cust.frm'], s) then
  writeln(s);
  errormsg.text := 'We are done with runcommand now s= '+ s;

Fedora 37, Lazarus 2.2.4 FPC 3.2.2 X64 Linux gtk2

John A. Ward, President

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus-ide.org/pipermail/lazarus/attachments/20230309/70cc19a9/attachment.htm>

Reply by email

zeljko
to john Ward
john Ward wrote 11 lines
*I have a program, segment included below, that partially works.? The first 'runcommand' example works, but the 2nd doesn't?* *If I type the lp command line, it prints perfectly..* ?if RunCommand('unix2dos', ['-n', '-f', '/mbs/mbs/file/cust.f','/mbs/mbs/file/cust.frm'],s) then ?writeln(s); ? if RunCommand('/bin/lp', ['-d', ' printer1','-o=raw' ,'/mbs/mbs/file/cust.frm'], s) then ? writeln(s); ? errormsg.text := 'We are done with runcommand now s= '+ s; *Fedora 37, Lazarus 2.2.4 FPC 3.2.2? X64 Linux gtk2*

Are you sure that lp is in /bin directory ?
Try lp instead of /bin/lp (if cmd lp works)

zeljko

Reply by email

Unknown author
to john Ward: I have a program, segment included below, that partially works. The first 'runcommand'…
john Ward wrote
*I have a program, segment included below, that partially works.? The first 'runcommand' example works, but the 2nd doesn't?* *If I type the lp command line, it prints perfectly..*

perhaps "which lp" will give you the proper path?
also "whereis lp" may point you to more than one... my bet is on "which lp"... on my system, it returns /usr/bin/lp ;)

NOTE: No off-list assistance is given without prior approval. *Please keep mailing list traffic on the list where it belongs!*

Reply by email