Then you probably just want to first resolve the PROCESS START COMMAND 
string, specifying the HANDLE <Handle> on the VAR RESOLVE request.  Then 
use the result string as the COMMAND you are submitting to the remote 
machine.

Or you can use a static handle for both the VAR SET and the PROCESS 
START...

David Bender
STAF/STAX Development
8-1268 (512-838-1268) 
IBM Austin Bldg. 903-5B002
Internet: [EMAIL PROTECTED]




"Ahmed Mostafa" <[EMAIL PROTECTED]> 
05/07/2008 12:43 PM

To
STAF <staf-users@lists.sourceforge.net>
cc
David Bender/Austin/[EMAIL PROTECTED]
Subject
Re: [staf-users] Share variables across commands






That's exactly what I'm trying to do: use variables for the calling handle 
only (not shared or system variables), but the code you provided doesn't 
work, it gives:
Variable resolution failed for string: echo {First} {Second} {Third}
You are trying to resolve a variable that does not exist.
That's what I expected as the VAR Set command has a handle and the PROCESS 
Start command has another one, so those variables aren't visible to it.

2008/5/7 David Bender <[EMAIL PROTECTED]>:

It depends on exactly what you are trying to do.  You can certainly use 
VAR SET to remotely set variables (maybe you can point me to the STAF 
documentation where that is not clear). 

For example, I can set some variables on a remote system: 

$ STAF remotemachine.company.com VAR SET VAR first=1st VAR second=2nd VAR 
third=3rd 

Response 
-------- 

And then run some STAF requests to the remote machine which reference 
those variables: 

$ STAF remotemachine.company.com PROCESS START SHELL COMMAND "echo {first} 
{second} {third}" RETURNSTDOUT STDERRTOSTDOUT WAIT 
Response 
-------- 
{ 
  Return Code: 0 
  Key        : <None> 
  Files      : [ 
    { 
      Return Code: 0 
      Data       : 1st 2nd 3rd 

    } 
  ] 
} 

$ STAF remotemachine.company.com PROCESS START SHELL COMMAND "echo {first} 
{second} {third}" RETURNSTDOUT STDERRTOSTDOUT WAIT 
Response 
-------- 
{ 
  Return Code: 0 
  Key        : <None> 
  Files      : [ 
    { 
      Return Code: 0 
      Data       : 1st 2nd 3rd 

    } 
  ] 
} 

David Bender
STAF/STAX Development
8-1268 (512-838-1268) 
IBM Austin Bldg. 903-5B002
Internet: [EMAIL PROTECTED]



"Ahmed Mostafa" <[EMAIL PROTECTED]> 
Sent by: [EMAIL PROTECTED] 
05/07/2008 01:39 AM 


To
STAF <staf-users@lists.sourceforge.net> 
cc

Subject
[staf-users] Share variables across commands








Hello,

I want to share some variables across some successive staf commands on a 
remote machine, do I have to register a static handle? (it is stated that 
the VAR Set command is not available for remote machine!). So how can I do 
this?

Thanks
-- 
Ahmed Mostafa
0123919750
[EMAIL PROTECTED]

Software Developer
IBM Egypt, Cairo Technology Development Center 
-------------------------------------------------------------------------
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference 
Don't miss this year's exciting event. There's still time to save $100. 
Use priority code J8TL2D2. 
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone_______________________________________________

staf-users mailing list
staf-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/staf-users




-- 
Ahmed Mostafa
0123919750
[EMAIL PROTECTED]
Software Developer
IBM Egypt, Cairo Technology Development Center 
-------------------------------------------------------------------------
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference 
Don't miss this year's exciting event. There's still time to save $100. 
Use priority code J8TL2D2. 
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone
_______________________________________________
staf-users mailing list
staf-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/staf-users

Reply via email to