Solved

Linux, Bash .profile does not execute

Posted on 2012-04-02
3
310 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
Comment Utility
you could edit the .bashrc script to include the path of the .profile you are sourcing.
0
 
LVL 30

Expert Comment

by:Kerem ERSOY
Comment Utility
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
Comment Utility
I already told him to include the .profile in is .bashrc script
0

Featured Post

Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

It’s 2016. Password authentication should be dead — or at least close to dying. But, unfortunately, it has not traversed Quagga stage yet. Using password authentication is like laundering hotel guest linens with a washboard — it’s Passé.
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 navigate the file tree with the shell. Use pwd to print the current working directory: Use ls to list a directory's contents: Use cd to change to a new directory: Use wildcards instead of typing out long directory names: Use ../ to move…
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.

772 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

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now