Sign in Join

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

Mailing lists / fpc-pascal / 2004-09

linux question

2 messages · 2 people ·

Reply by email Subscribe to this list Your subscription

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

Paul Aviles

Forgive me for asking.. I need to do a few things, one is to run a shell script and invoque program "prgA" and pass the result of program A back to the shell script. I guess I can do:

BACK = /sbin/prgA; echo $?

A) is that correct?
B) how does prgA report the output back, using a simple write statement?

Thanks

Paul

This message has been scanned for viruses and dangerous content by MailScanner, and is believed to be clean.

Reply by email

A.J. Venter
to Paul Aviles
Paul Aviles wrote 8 lines
Forgive me for asking.. I need to do a few things, one is to run a shell script and invoque program "prgA" and pass the result of program A back to the shell script. I guess I can do: BACK = /sbin/prgA; echo $? A) is that correct?

erm that's the EVIL way.
Try
BACK=`/sbin/prgA`

B) how does prgA report the output back, using a simple write statement?

For this one at least, yes, I've done many of those using little FPC shorts to enhance shell scripts.

Thanks Paul

Reply by email