When is .profile run




















Improve this question. Add a comment. Active Oldest Votes. You must ensure that the spawned shell is a login shell by adding the -l flag: su -l pythontest. Improve this answer. So what for are. I can put my export command to any file and execute it whenever I want.

I thought that. You should read the manual page for your shell. In man there is a topic "Invoked as an interactive login shell, or with --login". Is the problem of being an interactive shell?

When I use su command bash is not invoked by interactive login shell? Sign up or log in Sign up using Google. Sign up using Facebook. Since a shell invoked as sh does not attempt to read and execute commands from any other startup files, the --rcfile option has no effect. A non-interactive shell invoked with the name sh does not attempt to read any other startup files. When invoked as sh, bash enters posix mode after the startup files are read.

Bash attempts to determine when it is being run with its standard input connected to a network connection, as when executed by the remote shell daemon, usually rshd, or the secure shell daemon sshd. It will not do this if invoked as sh. The --norc option may be used to inhibit this behavior, and the --rcfile option may be used to force another file to be read, but neither rshd nor sshd generally invoke the shell with those options or allow them to be specified.

Last edited by RudiC; at AM.. Originally Posted by RudiC. Should that be bash , read man bash :. Last edited by mohtashims; at AM.. Auto transfer all aliases from one profile to another. Hi, I login to Linux and Solaris server using my personal user account "ms". I have several aliases set in my profile. Later i need to switch to another user account i. Default shell for user is Users who desire to have their. So, there should be no need to execute. Doesn't the cron require login from the user.

Then, from where does the cron execute? Please help!! Auto login with SFTP. Is there a way to still cat the password at the prompt Auto X when Login.

Can I modify the. Hello, I got this question which tells me to customize my login script. Anything else I can provide to clarify?

Running this directly in terminal means that there will be no subshell created. So you can use either two commands:. In the first case this will create a subshell that will not affect the environment variables of your system and they will be visible only to the subshell process. After finishing the subshell command none of the exports etc. In order for your changes applied in your script to have effect for the global environment the script has to be run with.

In order to make sure that you script is not runned in a subshel you can use this function. Again example is for Ubuntu shell.

The bash script runs in a separate subshell. In order to make this work you will need to source this other script as well. Stack Overflow for Teams — Collaborate and share knowledge with a private group.

Create a free Team What is Teams? Collectives on Stack Overflow. Learn more. Ask Question. Asked 11 years, 4 months ago. Active 4 years ago. Viewed k times. Anvesh 81 10 10 bronze badges. Amir Rustamzadeh Amir Rustamzadeh 3, 6 6 gold badges 32 32 silver badges 42 42 bronze badges.



0コメント

  • 1000 / 1000