In the simplest form I am puzzled why this script does not work as expected as a here script changing users with
su - user <<EOF.
su - db2prd<<EOF PARMDATE=1111111 echo parmdate echo $PARMDATE EOF
and removing the su/EOF part:
PARMDATE=1111111 echo parmdate echo $PARMDATE
I am unable to figure out why ksh variable assignment is not working and how to make it work, presuming the environment wasn't set, etc. I have tried everything I can search on. Variable assignment seems broken in the
su - <<EOF part.
This is just an example from a much larger script that switches users for some maintenance activities.