Here's how you would do it
set -o errexit -o nounset -o pipefail
cat << EndOfMessage | ${DOCKER_RUN} -i --name="${CONTAINER_NAME}" ${DOCKER_IMAGE} /bin/bash -s
set -o errexit -o nounset -o pipefail
!#####Please put your shell script below######
!######Make sure you escape dollar sign $######
VAR=SAMAH
env
&UC_JOBMD CMD="new_script.sh &USER# &PASS# \$VAR"
!##############################################
EndOfMessage
Original Message:
Sent: Jan 28, 2016 07:31 PM
From: SamahSohrab607228
Subject: encrypted passwords using &UC_JOBMD CMD - used in multi-line script?
Does anyone know if I can use the
&UC_JOBMD CMD within a multi-line script ?
We've moved the majority of our processing into docker containers. I'm providing templates that allow for users to create a set of shell commands that will all get sent to the docker container. I was wondering if I could pass an encrypted password from my PromptSet to that command.
I've used the encypted password on a single line script
&UC_JOBMD CMD="script.sh &USER# &PASS#"
But now I want to use this type of command
set -o errexit -o nounset -o pipefail
cat << EndOfMessage | ${DOCKER_RUN} -i --name="${CONTAINER_NAME}" ${DOCKER_IMAGE} /bin/bash -s
set -o errexit -o nounset -o pipefail
!#####Please put your shell script below######
!######Make sure you escape dollar sign $######
VAR=SAMAH
env
new_script.sh &USER# &PASS# \$VAR
!##############################################
EndOfMessage
I don't know if I need to put the &UC_JOBMD CMD around the whole text? Or if there is another way?
Thanks
Samah