Script is not getting executed

Hi All,

I have written a programme where i need to work in one session but when that session get executed it doesnt execute other programme till I write exit. Below is the script

#!/bin/bash
echo 'Going to start'
exectrusteduser.com sh.com
cd /UAT_Logs/CDCI_LOGS/SEEDADM
pwd
echo $B2K_SESSION_ID

in the above script

 exectrusteduser.com sh.com 

is to create session
below is output

uatapp1: /UAT_Logs/CDCI_LOGS/SEEDADM > ./123.sh
Going to start
PuTTY$
sh: PuTTY:  not found
$
$ exit
UAT_Logs/CDCI_LOGS/SEEDADM

in the ouput exit has written manually

And the question is . . . ?

how to execute the programme in that session only automatically without coming out

What do you mean by 'execute other programme'? What other programme are you trying to do?

Are you trying to feed input into exectrusteduser?

the programme after exectrusteduser.com sh.com line is not getting executed

Without knowing what the command:

exectrusteduser.com sh.com

does, we can only make wild guesses at what needs to be done. Two wild guesses that might work for you would be:

#!/bin/bash
echo 'Going to start'
exectrusteduser.com sh.com <<"EOF"
exit
EOF
cd /UAT_Logs/CDCI_LOGS/SEEDADM
pwd
echo $B2K_SESSION_ID

and:

#!/bin/bash
echo 'Going to start'
exectrusteduser.com sh.com < /dev/null
cd /UAT_Logs/CDCI_LOGS/SEEDADM
pwd
echo $B2K_SESSION_ID
1 Like

thanks