ابدأ بالتواصل مع الأشخاص وتبادل معارفك المهنية

أنشئ حسابًا أو سجّل الدخول للانضمام إلى مجتمعك المهني.

متابعة

Why at the login bash read .profile before .bash_login ?

user-image
تم إضافة السؤال من قبل R e n z o V i d o n i , Consultant , Various
تاريخ النشر: 2015/09/17
Adel Abdel Hamid
من قبل Adel Abdel Hamid , TSM technical support specialist , IBM

from

http://www.gnu.org/software/bash/manual/html_node/Bash-Startup-Files.html

 

"When Bash is invoked as an interactive login shell, or as a non-interactive shell with the --login option, it first reads and executes commands from the file /etc/profile, if that file exists. After reading that file, it looks for~/.bash_profile~/.bash_login, and ~/.profile, in that order, and reads and executes commands from the first one that exists and is readable. The --noprofile option may be used when the shell is started to inhibit this behavior."

 

 

Patrick O''Leary
من قبل Patrick O''Leary , CEO, CTO, Founder , eWitness, LLC

The login will get executed1 time at login, profiles gets executed with every shell/script that you run.

the login is read last to give you the chance to override the profile one knee only one time at login.

YASSER GHAREEB
من قبل YASSER GHAREEB , Graphic Designer , NEW VISION

  1.  BUT BELIEVE IN GUP
  2. MORE MONEY 

Sonny Wenfred Lafuente
من قبل Sonny Wenfred Lafuente , System Engineer , Entropy Solution Pte Ltd.

To check permissions and environment variables.

KHAJA AHSAN KHAN
من قبل KHAJA AHSAN KHAN , Associate Director , Hilton World Wide

the .profile gets executed first and then the .bash_login.

Huzefa Akhter
من قبل Huzefa Akhter , Head of IT Department , Wethaq Takaful Insurance Co

As linux is highly flexible, users are given an opportunity to change the name and location of envioronment setting files (even have a same file for multiple users), but as bash needs a pointer to start with, that pointer is hardcoded to be .profile 

dhakr qayid sufyan saeid الحبشي
من قبل dhakr qayid sufyan saeid الحبشي , موضف شركة صرافه , الإمام للصرافة

Login will be executed once upon login, and

Sourav Bose
من قبل Sourav Bose , Unix Infrastructure Administrator , Wipro Technologies

Because all enviromanetal varible updates along with reboot and stores in .profile file.

Priyanka Chavan
من قبل Priyanka Chavan , System Analyst/Senior System Engineer , Infosys

.profile file process before .bash_login to accomodate both interactive and non-interactive sessions

Thomas Siju
من قبل Thomas Siju , Service Engineer , Southern Naval Command

When the bash script executed in specific  log in shell then it runs required profile commands which exists

Ahmed Sayed
من قبل Ahmed Sayed , Embedded Systems Software Developer , freelancer

because .profile extension is used for files in terminal programs, profile file in Linux comes under the System startup files(defines user environment after reading the initialization files that you have set up when you log in to shell).

هل تحتاج لمساعدة في كتابة سيرة ذاتية تحتوي على الكلمات الدلالية التي يبحث عنها أصحاب العمل؟