.profile is not run on startup

Quick to answer questions about finding your way around Linux Mint as a new user.
Forum rules
There are no such things as "stupid" questions. However if you think your question is a bit stupid, then this is the right place for you to post it. Stick to easy to-the-point questions that you feel people can answer fast. For long and complicated questions use the other forums in the support section.
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
Locked
xpanta

.profile is not run on startup

Post by xpanta »

Hi,

For some reason my ~/.profile script is not run after startup and I need to do a "source .profile" the first time I start a terminal.

How can I solve this?

(I have done a chmode 755 to my profile script).

This is my script:

Code: Select all

# if running bash
if [ -n "$BASH_VERSION" ]; then
    # include .bashrc if it exists
    if [ -f "$HOME/.bashrc" ]; then
	. "$HOME/.bashrc"
    fi
fi

# set PATH so it includes user's private bin if it exists
if [ -d "$HOME/bin" ] ; then
    PATH="$HOME/bin:$PATH"
fi

export WORKON_HOME=$HOME/.virtualenvs
export PROJECT_HOME=$HOME/Dropbox/workspace/
source /usr/local/bin/virtualenvwrapper.sh
Last edited by LockBot on Wed Dec 28, 2022 7:16 am, edited 1 time in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
Skrell

Re: .profile is not run on startup

Post by Skrell »

I also would like to know the answer to this as i'm having the same problem!
BoscoBearbank
Level 2
Level 2
Posts: 59
Joined: Sat Nov 14, 2009 8:13 pm

Re: .profile is not run on startup

Post by BoscoBearbank »

My ~/.profile file:

Code: Select all

# ~/.profile: executed by the command interpreter for login shells.
# This file is not read by bash(1), if ~/.bash_profile or ~/.bash_login
# exists.
# see /usr/share/doc/bash/examples/startup-files for examples.
# the files are located in the bash-doc package.

# the default umask is set in /etc/profile; for setting the umask
# for ssh logins, install and configure the libpam-umask package.
#umask 022

# if running bash
if [ -n "$BASH_VERSION" ]; then
    # include .bashrc if it exists
    if [ -f "$HOME/.bashrc" ]; then
	. "$HOME/.bashrc"
    fi
fi

# set PATH so it includes user's private bin if it exists
if [ -d "$HOME/bin" ] ; then
    PATH="$HOME/bin:$PATH"
fi
and as for permissions:

Code: Select all

~$ dir -d .profile
-rw-r--r-- 1 a a 675 May 18 07:06 .profile
$HOME/bin is the first field in $PATH, therefore I conclude ~/.profile is working. Do you have ~/.bash_profile or ~/.bash_login files?
Locked

Return to “Beginner Questions”