Closed hostingnuggets closed 8 years ago
Hello, I believe this already works.
I created the ".profile" in my user's home with execution/user/group rights appropriated. The content of the file is a comment, then basic commands (e.g. eval) with ENV variable.
# ll /home/lshell/.profile -rwxr--r-- 1 lshell lshell 47 Jun 28 01:18 /home/lshell/.profile* # cat /home/lshell/.profile # Testing .profile echo "Hello World or $USER" eval "$(echo VAR=42)" v=VAR eval echo \${$v} # End of testing .profile
The variable to use is 'login_script':
# grep .profile /etc/lshell.conf login_script : "/home/lshell/.profile"
Considering you also have the latest -current- version: 0.9.16, you should be good to go:
> lshell --version lshell-0.9.16 - Limited Shell > su - lshell Password: You are in a limited shell. Type '?' or 'help' to get the list of allowed commands Hello World or lshell 42 lshell:~$
It seems relevant to point out that eval -due to its properties- can be a dangerous command to use.
unfortunately adding eval "$(rbenv init -)" to my lshell login_script does not work, see #89
Closing, duplicate of #89
Does lshell support a file such as the .bash_profile where one can run commands when the user logs in? I would like to run the following command as soon as the user logs in:
eval "$(rbenv init -)"