First, you need to understand that the perl process you are starting will
be run in the environment in which STAFProc is run, not in the environment
of the window/terminal that you are submitting the STAF PROCESS START
command from. So, when you say you are executing the STAF PROCESS START
command from the same directory where the perl file has been located, that
makes no difference as that is not the "current directory" from which the
perl command will be run (as it will be run via STAFProc's environment).
So, you should fully qualify the perl file and you might also want to
specify the WORKDIR option to also specify it as the working directory for
the process. Also, to return the stdout/stderr from running the process
so that you can see the error messages (like it cannot find the perl
file), you can specify the RETURNSTDOUT and STDERRTOSTDOUT options and the
WAIT option to wait for the process to complete (at least while you are
debugging any issues with running your Perl script).
For example, if your perl script is myScript.pl and it resides in
directory C:\myTests on the local system, you should submit the following
command to run it :
STAF local PROCESS START SHELL COMMAND "C:/myTests/myScript.pl" WORKDIR
"C:/myTests" RETURNSTDOUT STDERRTOSTDOUT WAIT
And see section "8.12 Process Service" in the STAF User's Guide at
http://staf.sourceforge.net/current/STAFUG.htm#HDRPROCSRV for more
information about these options for a PROCESS START request. See the
"Getting Started with STAF" guide at
http://staf.sourceforge.net/current/STAFGS.pdf for more information about
learning how to use STAF.
--------------------------------------------------------------
Sharon Lucas
IBM Austin, luc...@us.ibm.com
(512) 286-7313 or Tieline 363-7313
From: "Raja Narayanan" <v_rajnara...@rediffmail.com>
To: "staf-users" <staf-users@lists.sourceforge.net>
Date: 02/21/2011 07:34 AM
Subject: [staf-users] Run perl script using Staf command
Hello Staf-users,
Im trying to run a perl script through staf service using following
command.
STAF local PROCESS START SHELL COMMAND "perl script_name.pl" - It fails.
Note:
1. Similar result observed when tried to run the command without using
shell option as well.
2. Command executed from the same directory where the perl file has been
located.
Please help me out on this.
Thanks,
V Raja
------------------------------------------------------------------------------
The ultimate all-in-one performance toolkit: Intel(R) Parallel Studio XE:
Pinpoint memory and threading errors before they happen.
Find and fix more than 250 security defects in the development cycle.
Locate bottlenecks in serial and parallel code that limit performance.
http://p.sf.net/sfu/intel-dev2devfeb
_______________________________________________
staf-users mailing list
staf-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/staf-users
------------------------------------------------------------------------------
The ultimate all-in-one performance toolkit: Intel(R) Parallel Studio XE:
Pinpoint memory and threading errors before they happen.
Find and fix more than 250 security defects in the development cycle.
Locate bottlenecks in serial and parallel code that limit performance.
http://p.sf.net/sfu/intel-dev2devfeb
_______________________________________________
staf-users mailing list
staf-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/staf-users