August 20th, 2002, 06:08 PM
How could I save the STDOUT that is displayed after a command line issue of system("FTP ..")?
I want to be able to capture the screen output of that system call to FTP in a text file.
Thanks in advance!
August 20th, 2002, 07:00 PM
Using system() captures the return value of the program that executed (i.e. "did it succeed or fail?"). You want `COMMAND` (those are backticks) which returns the output.
August 20th, 2002, 07:18 PM
Not sure how to use `COMMAND`
Do the arguments get passed within the backticks?
@ARGS=("FTP", "arg1", "arg2");
`COMMAND, @ARGS` ?
August 20th, 2002, 07:21 PM
apparently the information from the application (FTP here) passed in system() call, can be redirected to a file...which is exactly what I need to do.
I just don't know how to redirect the info.
Last edited by rxsid; August 20th, 2002 at 08:17 PM.
August 21st, 2002, 12:09 AM
Yea... use backticks. Backticks return the output, so if you say:
The output of the command goes to the open filehandle FILE. Variables interpolate inside backticks, so you can put your parameters inside of them.
Last edited by Ctb; August 21st, 2002 at 12:15 AM.
August 21st, 2002, 01:58 PM
Thats exactly what I needed.
I do appreciate your help.