You need to make sure that "." is in the PATH for STAFProc (so that the OS will look in the working directory).
Here I get the same error:
# staf local process start shell command vmInfo.sh returnstdout
stderrtostdout wait returnfile /tmp/tests/vmInfo.sh workdir /tmp/tests
Response
--------
{
Return Code: 127
Key : <None>
Files : [
{
Return Code: 0
Data : sh: vmInfo.sh: command not found
}
{
Return Code: 0
Data : #!/bin/sh
echo "Hello"
}
]
}
# staf local shutdown shutdown
# export PATH=.:$PATH
# STAFProc &
# staf local process start shell command vmInfo.sh returnstdout
stderrtostdout wait returnfile /tmp/tests/vmInfo.sh workdir /tmp/tests
Response
--------
{
Return Code: 0
Key : <None>
Files : [
{
Return Code: 0
Data : Hello
}
{
Return Code: 0
Data : #!/bin/sh
echo "Hello"
}
]
}
So it works after adding "." to the PATH and restarting STAFProc.
Thanks,
David
David Bender 11501 Burnet Rd. Phone (T/L): 1-512-286-5315
STAF/STAX Development Bldg. 903-5B002 (363-5315)
Austin, TX ITN: 23635315
IBM Software Group, 78758-3400 Email: [email protected]
WPLC
From: Gary Guo <[email protected]>
To: [email protected]
Date: 07/20/2010 06:42 PM
Subject: [staf-users] WORKDIR doesn't work in PPROCESS START SHELL COMMAND
Hi,
I try to create a directory that includes all my scripts or executable.
So, I can use WORKDIR in PROCESS START SHELL COMMAND without defining
absolute path for each script or executable. You can see the script exists.
[r...@auto samples]# staf 192.168.x.y PROCESS START SHELL COMMAND
"vmInfo.sh" WAIT STDERRTOSTDOUT RETURNSTDOUT
RETURNFILE /root/STAF341/vmInfo.sh WORKDIR /root/STAF341/
Response
--------
{
Return Code: 127
Key : <None>
Files : [
{
Return Code: 0
Data : sh: vmInfo.sh: command not found
}
{
Return Code: 0
Data : #!/bin/sh
for i in `vmware-cmd -l`
do
echo "VMX: $i"
echo "VmPowerStatus: "
vmware-cmd $i getstate
echo "VmOs: "
vmware-cmd $i getconfig guestOs
echo "VmIp: ";
vmware-cmd $i getguestinfo ip;
echo ""
done
}
]
}
------------------------------------------------------------------------------
This SF.net email is sponsored by Sprint
What will you do first with EVO, the first 4G phone?
Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first
_______________________________________________
staf-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/staf-users
<<inline: graycol.gif>>
<<inline: ecblank.gif>>
------------------------------------------------------------------------------ This SF.net email is sponsored by Sprint What will you do first with EVO, the first 4G phone? Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first
_______________________________________________ staf-users mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/staf-users
