LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 04-27-2022, 10:54 AM   #1
Faki
Member
 
Registered: Oct 2021
Posts: 574

Rep: Reputation: Disabled
Setting .bash_profile settings on Ubuntu 18.04


Have made ~/.bash_profile in my home directory, that calls the file linge-profile.rc.

Here is the contents of ~/.bash_profile

Code:
gun_path="${HOME}/Opstk/bin/gun-1.0"
source ${gun_path}/linge/linge-profile.rc
And the contents of linge-profile.rc being

Code:
#!/bin/bash

linge-texlive-paths ()
{
  local -r tldir="${HOME}/Opstk/bld/texlive/2022"
  PATH=${tldir}/bin/x86_64-linux:${PATH}
  MANPATH=${tldir}/texmf-dist/doc/man:${MANPATH}
  INFOPATH=${tldir}/texmf-dist/doc/info:${INFOPATH}

  export PATH
  export MANPATH
  export INFOPATH
}

linge-texlive-paths
But, when I do echo $PATH, the directory ${tldir}/bin/x86_64-linux is not there. I also have a .profile. I am using Ubuntu 18.04.
 
Old 04-27-2022, 10:59 AM   #2
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 26,636

Rep: Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965
Quote:
Originally Posted by Faki View Post
Have made ~/.bash_profile in my home directory, that calls the file linge-profile.rc. Here is the contents of ~/.bash_profile
Code:
gun_path="${HOME}/Opstk/bin/gun-1.0"
source ${gun_path}/linge/linge-profile.rc
And the contents of linge-profile.rc being
Code:
#!/bin/bash
linge-texlive-paths ()
{
  local -r tldir="${HOME}/Opstk/bld/texlive/2022"
  PATH=${tldir}/bin/x86_64-linux:${PATH}
  MANPATH=${tldir}/texmf-dist/doc/man:${MANPATH}
  INFOPATH=${tldir}/texmf-dist/doc/info:${INFOPATH}

  export PATH
  export MANPATH
  export INFOPATH
}
linge-texlive-paths
But, when I do echo $PATH, the directory ${tldir}/bin/x86_64-linux is not there. I also have a .profile. I am using Ubuntu 18.04.
Why can't you just edit your PATH statement in ONE of your files, or add those statements there? Why source a separate file??
 
Old 04-27-2022, 12:48 PM   #3
Faki
Member
 
Registered: Oct 2021
Posts: 574

Original Poster
Rep: Reputation: Disabled
Because I am working on a user setup repository, such that user settings are not scattered all over the place.
 
Old 04-27-2022, 12:58 PM   #4
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 26,636

Rep: Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965
Quote:
Originally Posted by Faki View Post
Because I am working on a user setup repository, such that user settings are not scattered all over the place.
So you've got a .bash_profile, a .profile, .bashrc, and an linge-profile.rc....but don't want things 'scattered all over the place'?? They already ARE scattered.

Set things up in the default profile on your system, so any new users get the path info, by putting it in /etc/skel/.profile (or .bashrc). Edit your profile to have those variables, and you're done.
 
Old 04-27-2022, 01:05 PM   #5
Faki
Member
 
Registered: Oct 2021
Posts: 574

Original Poster
Rep: Reputation: Disabled
.profile and .bashrc were there already. Things are scattered, but not the actual commands (all are in directory ${HOME}/Opstk/bin/gun-1.0/linge). I just access them.
 
Old 04-27-2022, 01:07 PM   #6
Faki
Member
 
Registered: Oct 2021
Posts: 574

Original Poster
Rep: Reputation: Disabled
@TBOne What would you suggest as a good system? Remove .bash_profile and put things in the .bashrc? Have read that .bash_profile is intended for terminal prompt settings.
 
Old 04-27-2022, 01:55 PM   #7
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 26,636

Rep: Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965
Quote:
Originally Posted by Faki View Post
@TBOne What would you suggest as a good system? Remove .bash_profile and put things in the .bashrc? Have read that .bash_profile is intended for terminal prompt settings.
You were given this advice earlier; you then opened another thread for the same thing. Reported as duplicate.
 
Old 04-27-2022, 02:00 PM   #8
Faki
Member
 
Registered: Oct 2021
Posts: 574

Original Poster
Rep: Reputation: Disabled
With which one should we continue?
 
Old 04-27-2022, 02:02 PM   #9
Faki
Member
 
Registered: Oct 2021
Posts: 574

Original Poster
Rep: Reputation: Disabled
The other was about a problem as I could not see PATH being updated from ~/.bash_profile.
 
Old 04-28-2022, 01:38 AM   #10
ondoho
LQ Addict
 
Registered: Dec 2013
Posts: 19,872
Blog Entries: 12

Rep: Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053
Quote:
Originally Posted by Faki View Post
Have made ~/.bash_profile in my home directory, that calls the file linge-profile.rc.

Here is the contents of ~/.bash_profile

Code:
gun_path="${HOME}/Opstk/bin/gun-1.0"
source ${gun_path}/linge/linge-profile.rc
And the contents of linge-profile.rc being

Code:
#!/bin/bash

linge-texlive-paths ()
{
  local -r tldir="${HOME}/Opstk/bld/texlive/2022"
  PATH=${tldir}/bin/x86_64-linux:${PATH}
  MANPATH=${tldir}/texmf-dist/doc/man:${MANPATH}
  INFOPATH=${tldir}/texmf-dist/doc/info:${INFOPATH}

  export PATH
  export MANPATH
  export INFOPATH
}

linge-texlive-paths
But, when I do echo $PATH, the directory ${tldir}/bin/x86_64-linux is not there. I also have a .profile. I am using Ubuntu 18.04.
Did you troubleshoot this at all? 'set -x'? Maybe remove the rather pointless enclosing function? Come to think of it, that might be the reason it's not working. Dunno. I did NOT troubleshoot your code.
 
Old 04-28-2022, 02:15 AM   #11
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 21,842

Rep: Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308
Quote:
Originally Posted by Faki View Post
The other was about a problem as I could not see PATH being updated from ~/.bash_profile.
did you read your other thread about how and when those files are processed (~/.bash_profile and ~/.bashrc)
 
  


Reply

Tags
environment variable, profile



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
.bash_profile overrides the settings in /etc/profile tomkoshy Linux - General 3 05-22-2013 08:47 PM
problem setting up gcc. I think I need to find the bash_profile file? Taylrl Linux - Newbie 5 11-14-2011 11:47 AM
How to apply settings (.bash_profile, .bashrc, .inputrc) to all users? veeruk101 Linux - Newbie 12 10-26-2011 11:14 AM
Problem when setting up bash_profile elgyn Linux From Scratch 5 07-14-2010 08:31 PM
Sysdate setting in bash_profile malickhat Linux - Newbie 2 03-29-2010 01:39 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 07:45 PM.

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