LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Desktop
User Name
Password
Linux - Desktop This forum is for the discussion of all Linux Software used in a desktop context.

Notices


Reply
  Search this Thread
Old 02-06-2015, 01:17 PM   #1
otoomet
Member
 
Registered: Oct 2004
Location: Tartu, Århus,Nürnberg, Europe
Distribution: Debian, Ubuntu, Puppy
Posts: 619

Rep: Reputation: 45
lxde login shell


Dear all,
I recently started using lxde. I have a bash-script I want to be executed during my login that sets up environment, run certain commands, etc, in my .profile. Note that it is /bash/-script, i.e. using bash syntax.
I am using ubuntu 14.04, lxde 0.5.0-4ubuntu4

However, it seems .profile is executed by /bin/sh, not by /bin/bash, despite my login shell being specified as bash in /etc/passwd. This means that the script does not work correctly. I have tried to execute .bash_profile from .profile with bash, but obviously, the child's environment is not preserved elsewhere in the session.

Is there a way to force to run my .profile using bash?

Cheers,
Ott
 
Old 02-06-2015, 09:37 PM   #2
veerain
Senior Member
 
Registered: Mar 2005
Location: Earth bound to Helios
Distribution: Custom
Posts: 2,524

Rep: Reputation: 319Reputation: 319Reputation: 319Reputation: 319
If ~/.bash_profile is present then bash uses it instead of .profile.

From .bash_profile you can run .profile by

Code:
source ~/.profile
 
Old 02-06-2015, 11:06 PM   #3
otoomet
Member
 
Registered: Oct 2004
Location: Tartu, Århus,Nürnberg, Europe
Distribution: Debian, Ubuntu, Puppy
Posts: 619

Original Poster
Rep: Reputation: 45
... but the problem is that .bash_profile is not executed. lxde seems to run
Code:
sh .profile
I can call .bash_profile from profile as
Code:
bash .bash_profile
but in this case the environment is not passed back to the login shell...
 
Old 02-07-2015, 02:31 AM   #4
veerain
Senior Member
 
Registered: Mar 2005
Location: Earth bound to Helios
Distribution: Custom
Posts: 2,524

Rep: Reputation: 319Reputation: 319Reputation: 319Reputation: 319
Quote:
Originally Posted by otoomet View Post
... but the problem is that .bash_profile is not executed. lxde seems to run
Code:
sh .profile
I can call .bash_profile from profile as
Code:
bash .bash_profile
but in this case the environment is not passed back to the login shell...
In this case put this line in .profile:

Code:
source ~/.bash_profile
instead of 'bash .bash_profile'.
 
Old 02-07-2015, 07:52 AM   #5
otoomet
Member
 
Registered: Oct 2004
Location: Tartu, Århus,Nürnberg, Europe
Distribution: Debian, Ubuntu, Puppy
Posts: 619

Original Poster
Rep: Reputation: 45
If I source it with 'source', will the .bash_profile then run by sh or by bash?

Anyway, thanks for thinking with me :-)
 
Old 02-07-2015, 10:53 AM   #6
veerain
Senior Member
 
Registered: Mar 2005
Location: Earth bound to Helios
Distribution: Custom
Posts: 2,524

Rep: Reputation: 319Reputation: 319Reputation: 319Reputation: 319
Quote:
Originally Posted by otoomet View Post
If I source it with 'source', will the .bash_profile then run by sh or by bash?

Anyway, thanks for thinking with me :-)
Yes. It will be run by sh or bash.
 
Old 02-14-2015, 08:45 AM   #7
otoomet
Member
 
Registered: Oct 2004
Location: Tartu, Århus,Nürnberg, Europe
Distribution: Debian, Ubuntu, Puppy
Posts: 619

Original Poster
Rep: Reputation: 45
. .bash_profile can well include the environment but unfortunately it is execuded by sh, not by bash (and leads to a number of syntax errors because of that). Seems like I should talk to lxde gurus...

Thanks anyway :-)
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Changing The Login Screen Background in Debian Wheezy(LXDE)? xcanox Debian 5 11-30-2014 10:37 PM
[SOLVED] HOWTO: Debian 7 (Wheezy) LXDE Auto Numlock, both BEFORE and AFTER login luvr Debian 3 04-08-2014 09:00 PM
Login Shell / Non-Login shell Clarification needed (RHEL 6.3) kingston Linux - Newbie 1 12-07-2012 12:51 AM
LXDE: add username to login request ddalley Linux - Newbie 2 11-17-2011 01:07 PM
Unable to login to Gnome session after installing lxde ugge Ubuntu 1 08-08-2009 03:14 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Desktop

All times are GMT -5. The time now is 01:26 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration