Quote:
Originally Posted by
Judo_Bear
I am trying to combine these all on one line.
It's going to be difficult to automate
su. It insists on interactive authentication, and doesn't run commands listed after it since those are ones your current shell expects to do. It can be told to run things given on the commandline, but then it doesn't prompt you for more commands when it's done!
You could configure
sudo instead, to allow you and only you(or perhaps some group of users, etc, etc.) to run a shell under the 'account' user without a password and then, modify account's
~/.profile or
~/.kshrc to run
. /home/i5/i5.4/release/account/profile.ksh automatically on login, as well as set the prompt and change directory to where you want. So you go from sudo to doing what you want in one step, or
su - account and one password to being setup as you want.