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
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.
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.