Solved

Linux, Bash .profile does not execute

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

Efficient way to get backups off site to Azure

This user guide provides instructions on how to deploy and configure both a StoneFly Scale Out NAS Enterprise Cloud Drive virtual machine and Veeam Cloud Connect in the Microsoft Azure Cloud.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Virtual Box issue 6 85
Install MySQL 5.6 and PHP on Centos Linux 6 101
Linux hostname change 2 55
Setting up two Raspberry Pi gateways/routers 3 40
How many times have you wanted to quickly do the same thing to a list but found yourself typing it again and again? I first figured out a small time saver with the up arrow to recall the last command but that can only get you so far if you have a bi…
Setting up Secure Ubuntu server on VMware 1.      Insert the Ubuntu Server distribution CD or attach the ISO of the CD which is in the “Datastore”. Note that it is important to install the x64 edition on servers, not the X86 editions. 2.      Power on th…
Learn how to find files with the shell using the find and locate commands. Use locate to find a needle in a haystack.: With locate, check if the file still exists.: Use find to get the actual location of the file.:
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…

867 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

12 Experts available now in Live!

Get 1:1 Help Now