Auto transfer all aliases from one profile to another

Hi,

I login to Linux and Solaris server using my personal user account "ms1104" .

I have several aliases set in my profile.

Later i need to switch to another user account i.e. "wlsuser" and below is the command i use

sudo -u wlsuser -s -H

i do not have authority to modify the profile for wlsuser account.

I wish to carry all my aliases from "ms1104" to "wlsuser" and all the aliases should work after switching to account "wlsuser"

Create a separate file in your (ms1104) home directory that defines all of the aliases you use when you login as ms1104 by moving those alias definitions from your .profile (or whatever startup file your shell uses to define aliases when you login) file and adding a line in your .profile file to source that file. For example if you moved the alias definitions into .ms1104aliases , add the line:

. .ms1104aliases

to your .profile file.

Then after you sudo to user wisusr, run the command:

. ~mis1104/.ms1104aliases

before you do anything else.