1

I want to source a file in .bashrc only for my user id when I sudo to the functional id. it should not be sourced when other user sudo in.

0

1 Answer 1

3

add to the .bashrc

[[ -f .$(logname).bashrc ]] && source .$(logname).bashrc

and put your commands into the

.your_login.bashrc

If you don't have logname command can use

who am i | awk '{print $1}

instead of the logname

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .