Sharon,
Thank you very much! The problem was caused by not using full-path, it
goes well with the command ". ~/functions" or ". /functions". Aagin, thank
you for your quick answer^_^
Best regards,
Ye, Ying Ying(叶莹莹)
Software engineer, 3rd-party SAN test
IBM GCG System & Technology Lab
Tel:+86-21-60928963
Email: ying...@cn.ibm.com
Add: 1F, Building#10, NO.399 Ke Yuan Road, Zhangjiang Innovation Park,
201203, Shanghai, China
From: Sharon Lucas <luc...@us.ibm.com>
To: Ying Ying YY Ye/China/IBM@IBMCN,
Cc: staf-users@lists.sourceforge.net
Date: 2014/07/16 20:07
Subject: Re: [staf-users] . command N/A in ksh when sent in STAF
way
What is the STAF PROCESS START command that your
STAFLib.run_process_command() function is submitting to run the ".
functions" file? Note that all STAF service requests (like a PROCESS
START request) are run within the environment that STAFProc is running in
(not within the command shell from which it is submitted), so you'll
probably need to fully-qualify the path to the functions file. For
example if the functions file is located in directory path /test/project:
". /test/project/functions"). Is this file really named functions or is
it functions.sh?
Does it work if you run it using the STAF command line executable? For
example, here I'm using a PROCESS START request (using the SHELL option)
to run a file named /test/test.sh that contains shell commands:
# STAF local PROCESS START SHELL COMMAND ". /test/test.sh" RETURNSTDOUT
STDERRTOSTDOUT WAIT
Response
--------
{
Return Code: 0
Key : <None>
Files : [
{
Return Code: 0
Data : This is a test
}
]
}
#
--------------------------------------------------------------
Sharon Lucas
IBM Austin, luc...@us.ibm.com
(512) 286-7313 or Tieline 363-7313
From: Ying Ying YY Ye <ying...@cn.ibm.com>
To: staf-users@lists.sourceforge.net,
Date: 07/16/2014 05:02 AM
Subject: [staf-users] . command N/A in ksh when sent in STAF way
Hi guys,
I'm a little confused with the problem, which is as follows:
I need to run the command ". functions"(the functions file contains shell
functions) in my test machine, so the python script in my automation
machine contains following line:
tmp = STAFLib.run_process_command(handle,machine_ip,". functions")
the result is that tmp[0] returns 1,which means the command cannot be
executed successfully. And the return code of STAF for 1 is:
1
Invalid API
This indicates that a process has tried to call an invalid internal STAF
API. If this error occurs, report it to the authors.
However, it is successful when I typed the command ". functions" manually
in my test machine. Besides, /bin/usr/shell(ksh) is used in test machine.
Hence, why does the command fail in STAF way? Does anyone have any idea?
Many thanks.
Best regards,
Ye, Ying Ying(叶莹莹)
Software engineer, 3rd-party SAN test
IBM GCG System & Technology Lab
Tel:+86-21-60928963
Email: ying...@cn.ibm.com
Add: 1F, Building#10, NO.399 Ke Yuan Road, Zhangjiang Innovation Park,
201203, Shanghai, China
------------------------------------------------------------------------------
Want fast and easy access to all the code in your enterprise? Index and
search up to 200,000 lines of code with a free copy of Black Duck
Code Sight - the same software that powers the world's largest code
search on Ohloh, the Black Duck Open Hub! Try it now.
http://p.sf.net/sfu/bds_______________________________________________
staf-users mailing list
staf-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/staf-users
------------------------------------------------------------------------------
Want fast and easy access to all the code in your enterprise? Index and
search up to 200,000 lines of code with a free copy of Black Duck
Code Sight - the same software that powers the world's largest code
search on Ohloh, the Black Duck Open Hub! Try it now.
http://p.sf.net/sfu/bds
_______________________________________________
staf-users mailing list
staf-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/staf-users