I don't think this has anything to do with the alias being defined in the 
profile.  I can reproduce the problem just from some command line 
requests.  Here is what I  found (on a  Linux system), including a 
workaround.

First, define an alias (have "osname" run the "uname" command): 

# osname
-bash: osname: command not found

# uname
Linux

# alias osname=uname

# osname
Linux
 
Using "osname" as the PROCESS COMMAND results in an error similar to 
yours:
 
# STAF local PROCESS START SHELL COMMAND "osname" RETURNSTDOUT 
STDERRTOSTDOUT WAIT
Response
--------
{
  Return Code: 127
  Key        : <None>
  Files      : [
    {
      Return Code: 0
      Data       : sh: osname: command not found

    }
  ]
}

If we use backticks around osname, then that does execute the aliased 
command, but then the shell tries to execute the output (in this case 
"Linux"):

# STAF local PROCESS START SHELL COMMAND "`osname`" RETURNSTDOUT 
STDERRTOSTDOUT WAIT
Response
--------
{
  Return Code: 127
  Key        : <None>
  Files      : [
    {
      Return Code: 0
      Data       : sh: Linux: command not found

    }
  ]
}

So, if you do something like "echo `osname`", that works:

# STAF local PROCESS START SHELL COMMAND "echo `osname`" RETURNSTDOUT 
STDERRTOSTDOUT WAIT
Response
--------
{
  Return Code: 0
  Key        : <None>
  Files      : [
    {
      Return Code: 0
      Data       : Linux

    }
  ]
}

Maybe someone else on the mailing list has a better solution.

Thanks, 
David 

David Bender 
STAF/STAX Development 
IBM Software Group, WPLC 
 
11501 Burnet Rd. 
Bldg. 903-5B002 
Austin, TX 78758-3400 
 
Phone (T/L): 1-512-286-5315 (363-5315) 
ITN: 23635315 
Email: bda...@us.ibm.com 
 





From:
"Uma Maheswar Chilukuri" <u...@mach.com>
To:
<staf-users@lists.sourceforge.net>
Date:
01/13/2010 06:12 AM
Subject:
[staf-users] Executing aliases using PROCESS service



Hi,
How to execute an alias mentioned in remote machine(solaris) profile from 
a linux box using PROCESS (or any other) serivce? 
When I tried to execute getting the following error.  Note that 
“aliascommand” executes successfully on remte machine independently.
[test:~/perl]$STAF remotemachine PROCESS  START SHELL COMMAND 
"aliascommand" returnstdout stderrtostdout wait
Response
--------
{
  Return Code: 1
  Key        : <None>
  Files      : [
    {
      Return Code: 0
      Data       : sh: aliascommand: not found
    }
  ]
}
Thanks
Uma.
------------------------------------------------------------------------------
This SF.Net email is sponsored by the Verizon Developer Community
Take advantage of Verizon's best-in-class app development support
A streamlined, 14 day to market process makes app distribution fast and 
easy
Join now and get one step closer to millions of Verizon customers
http://p.sf.net/sfu/verizon-dev2dev 
_______________________________________________
staf-users mailing list
staf-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/staf-users



------------------------------------------------------------------------------
This SF.Net email is sponsored by the Verizon Developer Community
Take advantage of Verizon's best-in-class app development support
A streamlined, 14 day to market process makes app distribution fast and easy
Join now and get one step closer to millions of Verizon customers
http://p.sf.net/sfu/verizon-dev2dev 
_______________________________________________
staf-users mailing list
staf-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/staf-users

Reply via email to