ksh script to execute 2 variabless in universe enviroment

Hello, Im trying to write a ksh script that will enter the universe environment as user kourier (switching to this specific user automatically launches to the TCL prompt). At the TCL " > " prompt i want to execute two variables. However, it wont recognize the second variable (user input Answer) due to the space in between the two variables. Please help :confused:

#!/bin/ksh

printf "Enter Account name: "
read Answer

SWITCHACCOUNT="LOGTO" 

su - kourier $SWITCHACCOUNT $Answer

script output and error:

Enter Account name: ARENA
Account "" is not set up for uniVerse.

Hello seekryts15,

Assuming that the LOGTO command/script is expecting to have a parameter supplied, I would guess that it might be in the parsing so double quotes may help. I'd maybe change it to use the -c flag of su too.

Pop a set -x in before it too to show you what it's trying to do. Obviously take that out when you want to use it properly.

#!/bin/ksh

printf "Enter Account name: "
read Answer

SWITCHACCOUNT="LOGTO" 

set -x
su - kourier -c "$SWITCHACCOUNT $Answer"

If it still doesn't work, post the output and I/we will have another think.

Kind regards,
Robin

Hi Robin,
Thanks for the quick reply. I have applied the changes but since the user "kourier" shell is set to launch in universe it sees "-c" as a command entry. Any ideas would be appreciated, thanks

Error:

Enter Account name: ARENA
+ su - kourier -c LOGTO ARENA
Verb ".C" is not in your VOC.

Maybe I'm getting mixed up with remote shell. Try dropping the -c

I'm not sure what "Universe" is. Does this account have a changed default shell or something in the auto-profile (depends which shell)

grep kourier /etc/passwd

It doesn't like the "set -x"

+ su - kourier LOGTO ARENA
Account "" is not set up for uniVerse.

I went ahead and removed that as well. As a test on a single variable it works fine. Only when I try to introduce two variables.

Single variable tested good:

ACCOUNTCHK="WHO"

su - kourier $ACCOUNTCHK

OUTPUT:

Enter Account name: ARENA
12 KOURIER From kourier

---------- Post updated at 04:52 AM ---------- Previous update was at 04:50 AM ----------

I just dont know how to get it to recognize the space in between the two variables so it can execute the entire line.

---------- Post updated at 04:55 AM ---------- Previous update was at 04:52 AM ----------

the default shell for kourier is:

shell=/uv/bin/uv

I regret that I'm stuck then. I have no familiarity with Universe. Is it purchased software?

Robin

its a project I'm working on for my job :confused: