Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Linux, Bash .profile does not execute

Posted on 2012-04-02
3
Medium Priority
?
334 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Survive A High-Traffic Event with Percona

Your application or website rely on your database to deliver information about products and services to your customers. You can’t afford to have your database lose performance, lose availability or become unresponsive – even for just a few minutes.

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…
SSH (Secure Shell) - Tips and Tricks As you all know SSH(Secure Shell) is a network protocol, which we use to access/transfer files securely between two networked devices. SSH was actually designed as a replacement for insecure protocols that sen…
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…
How to Install VMware Tools in Red Hat Enterprise Linux 6.4 (RHEL 6.4) Step-by-Step Tutorial
Suggested Courses

671 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