Mailing List Archive: 49091 messages
  • Home
  • Script library
  • AltME Archive
  • Mailing list
  • Articles Index
  • Site search
 

Problem with call function

 [1/6] from: tmoeller:fastmail:fm at: 9-Sep-2009 11:20


Hi, i am getting al little crazy at this moment. I have a small script which should collect some performance data from a Linux box via plink commandline call on a Windows box. This is the line of code: call/output/wait {plink adwh01-p-ng-db2ux1-b -pw 10hwda -m LinMon.cmd} %myout.txt So if i modify this to see the output on the console like this: call/console/wait {plink adwh01-p-ng-db2ux1-b -pw 10hwda -m LinMon.cmd} everything runs fine. But i need this to be written into a file for later analysis. This what is not working here. I tried some more somple command like a dir, This works with /output option. So, i guess it depends on the plink command. Perhaps cannot find the output parameter behind it?? Instead of writing it to a file i tried to write it to a Rebol String which fails as well. Hope there is anyone who can help me out of this misery. Thorsten -- http://www.fastmail.fm - The way an email service should be

 [2/6] from: tmoeller:fastmail:fm at: 9-Sep-2009 10:55


Hi, i am getting al little crazy at this moment. I have a small script which should collect some performance data from a Linux box via plink commandline call on a Windows box. This is the line of code: call/output/wait {plink adwh01-p-ng-db2ux1-b -pw 10hwda -m LinMon.cmd} %myout.txt So if i modify this to see the output on the console like this: call/console/wait {plink adwh01-p-ng-db2ux1-b -pw 10hwda -m LinMon.cmd} everything runs fine. But i need this to be written into a file for later analysis. This what is not working here. I tried some more somple command like a dir, This works with /output option. So, i guess it depends on the plink command. Perhaps cannot find the output parameter behind it?? Instead of writing it to a file i tried to write it to a Rebol String which fails as well. Hope there is anyone who can help me out of this misery. Thorsten -- http://www.fastmail.fm - Send your email first class

 [3/6] from: semseddinm:bircom at: 9-Sep-2009 14:14


Hi, You may try to redirect your output in your command line string; call/shell "test.exe >c:\test.txt" ;does not work without /shell

 [4/6] from: tmoeller:fastmail:fm at: 9-Sep-2009 15:07


Hi Semseddin, great! It works! I tried a lot of options an the redirect on the command line, but witout the /shell option. From the online help that does not become clear to me. OK.Always learning...... Thanks a lot your help and making this List one of the most helpful ones i know. Thorsten On Wed, 09 Sep 2009 14:14 +0300, "Semseddin Moldibi [ Bircom ]" <semseddinm-bircom.com> wrote:
> Hi, > You may try to redirect your output in your command line string;
<<quoted lines omitted: 47>>
> To unsubscribe from the list, just send an email to > lists at rebol.com with unsubscribe as the subject.
-- http://www.fastmail.fm - Choose from over 50 domains or use your own

 [5/6] from: petr:krenzelok:seznam:cz at: 9-Sep-2009 15:30


Hello, not much experience with complicated 'call set-up on my side, but I did few tidbits here or there. Here's my experience with command line. 1) you can use redirection to file directly on command-line - not requiring rebol imo. Here's an example: call "dir c: >> test.txt" print read %test.txt 2) if you want to get your data into REBOL, you are doing it correctly. You either use string, or file, or port, according to 'call help: /output -- Redirects stdout to out out -- (Type: string port file url none) hence following works: call/output "dir c:" %test2.txt print read %test2.txt So - if it does not work for you, check if you are using latest REBOL version, and if so, I think that plink itself might be the culprit, not giving output properly to console .... -pekr- Thorsten Moeller napsal(a):

 [6/6] from: petr:krenzelok:seznam:cz at: 9-Sep-2009 11:38


Hello, not much experience with complicated 'call set-up on my side, but I did few tidbits here or there. Here's my experience with command line. 1) you can use redirection to file directly on command-line - not requiring rebol imo. Here's an example: call "dir c: >> test.txt" print read %test.txt 2) if you want to get your data into REBOL, you are doing it correctly. You either use string, or file, or port, according to 'call help: /output -- Redirects stdout to out out -- (Type: string port file url none) hence following works: call/output "dir c:" %test2.txt print read %test2.txt So - if it does not work for you, check if you are using latest REBOL version, and if so, I think that plink itself might be the culprit, not giving output properly to console .... -pekr- Thorsten Moeller napsal(a):

Notes
  • Quoted lines have been omitted from some messages.
    View the message alone to see the lines that have been omitted