When is bash profile loaded




















If any of the files exist but cannot be read, Bash reports an error. Tildes are expanded in filenames as described above under Tilde Expansion see Tilde Expansion. The --noprofile option may be used when the shell is started to inhibit this behavior. This may be inhibited by using the --norc option. Bash behaves as if the following command were executed:. As noted above, if a non-interactive shell is invoked with the --login option, Bash attempts to read and execute commands from the login shell startup files.

Scenario 1 : interactive login shell interactive means you can do user input. Note this does NOT include cron jobs! A login shell is the first shell that is spawned when you login, but does not include sub-shells So basically this is the command prompt you get right when you login. What will bash do?

But it will only read one of. So it will quit after it finds one and reads it. Scenario 2 : interactive non-login This is a shell that is started after the first login shell. This shell is one that allows user input. Scenario 3 : non-interactive shell for example cronjob When non-interactive, it doesn't load any of the files at all. I believe this is why you should always specify the absolute path in any cronjobs because none of the config files get executed by default. From bash 1 - Linux man page.

Sign up to join this community. The best answers are voted up and rise to the top. Stack Overflow for Teams — Collaborate and share knowledge with a private group. Create a free Team What is Teams? Learn more.

What are the functional differences between. Asked 10 years, 6 months ago. Active 1 month ago. Viewed k times. Improve this question. Bob Ortiz 4 4 silver badges 21 21 bronze badges. This sources the file you had just edited in history. See What is bang dollar in bash. So you can call bashs from next time. You can find more information about bashrc.

For terminal it may be useful to reference this issue ;. I use Debian and I can simply type exec bash to achieve this. I can't say if it will work on all other distributions.

I am running Sierra, and was working on this for a while trying all recommended solutions. I became confounded so eventually tried restarting my computer! It worked. 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. How to reload. Ask Question. Asked 10 years, 10 months ago.

Active 1 year, 6 months ago. Viewed k times. How can I reload. Improve this question. Arsen Khachaturyan 6, 4 4 gold badges 35 35 silver badges 37 37 bronze badges. Add a comment. Active Oldest Votes. Improve this answer. SiegeX SiegeX k 21 21 gold badges silver badges bronze badges. If you do this often you can just alias it as br. I can't get changes made to.



0コメント

  • 1000 / 1000