SetScript environment variables values are missing when calls another script

book

Article ID: 209847

calendar_today

Updated On:

Products

CA Spectrum

Issue/Introduction

When the SetScript calls another script, environment variables from the SetScript are no longer available on another script.

Environment

Release : 10.4.1

Component : Spectrum Applications

Resolution

When you call another script like below, environment variables and functions from the previous script will not be accessible:

./SetScript_DG "logs/$FILE_NAME" &

You have to call another script like below to preserve the environment variable and functions from the previous script:

source ./SetScript_DG "logs/$FILE_NAME" &

OR

. ./SetScript_DG "logs/$FILE_NAME" &

For further information about "source" in a shell script, please take a look at this URL:

https://linuxize.com/post/bash-source-command/

Attachments