Solved

Linux, Bash .profile does not execute

Posted on 2012-04-02
3
314 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 500 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

Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

Question has a verified solution.

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

Suggested Solutions

rdate is a Linux command and the network time protocol for immediate date and time setup from another machine. The clocks are synchronized by entering rdate with the -s switch (command without switch just checks the time but does not set anything). …
Join Greg Farro and Ethan Banks from Packet Pushers (http://packetpushers.net/podcast/podcasts/pq-show-93-smart-network-monitoring-paessler-sponsored/) and Greg Ross from Paessler (https://www.paessler.com/prtg) for a discussion about smart network …
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.

828 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