Can't source file through ENVAR ENV while running a ksh script on Linux box

book

Article ID: 49701

calendar_today

Updated On:

Products

CA Workload Automation AE - Business Agents (AutoSys) CA Workload Automation AE - Scheduler (AutoSys) CA Workload Automation Agent CA Workload Automation Agents DSERIES- SERVER CA Workload Automation DE - System Agent (dSeries)

Issue/Introduction

Description:

The job below attempted to source /home/compops/.profile.esp did not work on Linux agent.

It did work if I sourced the file from a command prompt and then ran the script. The script uses Korn shell

.
LINUX_JOB PERLJOB DOCMEM(N800UNIX)
AGENT LJ_LINUX101
SCRIPTNAME /home/compops/perltest.pl
ENVAR ENV=/home/compops/.profile.esp
ARGS %USER1 %USER2 %USER3
USER compops
RUN DAILY
ENDJOB

Solution:

Investigation found the issue was caused by the difference between two Korn shell versions ksh-93 and ksh-88, namely with ksh-93 the ENV defined file could be read only for interactive shells.

In this case, it meant one could not use the ENV in the jobs if the Linux was set up with ksh93.

Solution options were:

  1. Put the environment variables sourcing into the script instead of set up ENVAR ENV clause in the job definition, or

  2. Use the ksh88

Environment

Release: ATSAGE99000-11.3-Workload Automation AE-Remote Agent
Component: