Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Linux, Bash .profile does not execute

Posted on 2012-04-02
3
Medium Priority
?
336 Views
Last Modified: 2012-04-02
I am running RHEL 6.2, and created a user but it does not execute a .profile file:

[root@xxx02 ~]# su - brk
[brk@xxx02 ~]$
[brk@xxx02 ~]$ echo $0
-bash
[brk@xxx02 ~]$
[brk@xxx02 ~]$ . ./.profile

MQSI 7.0.0.1
/opt/ibm/mqsi/7.0

[brk@xxx02 ~]$

Open in new window


How can I get the .profile to execute upon swtiching to the user
0
Comment
Question by:Los Angeles1
  • 2
3 Comments
 
LVL 11

Accepted Solution

by:
jgiordano earned 2000 total points
ID: 37796278
you could edit the .bashrc script to include the path of the .profile you are sourcing.
0
 
LVL 30

Expert Comment

by:Kerem ERSOY
ID: 37796314
If you want automatic running then edit your  ~/.bashrc (~ means your home directory)

Add this line at the end of the file:


.  ~/.profile

Open in new window


If you want to run it from the command line then use this command:

source ./.profile

Open in new window


Cheers,
K.
0
 
LVL 11

Expert Comment

by:jgiordano
ID: 37796381
I already told him to include the .profile in is .bashrc script
0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

If you have a server on collocation with the super-fast CPU, that doesn't mean that you get it running at full power. Here is a preamble. When doing inventory of Linux servers, that I'm administering, I've found that some of them are running on l…
In part one, we reviewed the prerequisites required for installing SQL Server vNext. In this part we will explore how to install Microsoft's SQL Server on Ubuntu 16.04.
Learn how to get help with Linux/Unix bash shell commands. Use help to read help documents for built in bash shell commands.: Use man to interface with the online reference manuals for shell commands.: Use man to search man pages for unknown command…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.
Suggested Courses
Course of the Month13 days, 7 hours left to enroll

963 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question