The Case of the Reluctant .bashrc


#1

Hmmmm… mysterious. Worked fine on a previous install.

Am using Unstable of May 19, 2018, LXDE desktop.

I added a .bashrc to my /usr/home/username directory but it is doing absolutely nothing when I log out and then in again to try it out.

Not activating.

Does one need to set some special permissions or something ?
Is LXTerminal ok or should I be using something else ?
I just have some stuff to change directory name colors
and a line with an alias to activate 32 bit wine apps to work.

Also tried installing bash and then typing “bash” to go into bash, no change.

How does one make Bash the default shell and what am I missing ?

Thank
J.


#2

chsh -s /usr/local/bin/bash Jimserac ?
https://www.freebsd.org/doc/handbook/shells.html


#3

~/.bashrc is non-login. E.g.
for a subshell of Midnight Commander or for a SubShell within bash itself.

What You want is: ~/.profile

Read man bash Section Files at the bottom.


#4

Thanks fellow inmates !

What bugs me is that the last time I tried this, I just put the .bashrc in the home user directory, logged out, logged in, and it worked as soon as I opened a shell.

I must have done some export or something and didn’t write it down.

I’ll try .profile.

Thank agin

J


#5

Weird… How can you tell “it’s not activating”?

.bashrc is a shell script that Bash runs whenever it is started interactively…

Contrast .bash_profile and .profile which are only run at the start of a new login shell


#6

I can tell cuz nice colors I put in for when I do “ls” are not showing.

Same ugly hard to read purple directory name.
Also alias for run 32 bit apps under wine not working eithar.

Ugh ! Non-aesthetic.

Brief digression on Ruskin’s theories and … er…no wait, got to get back to do stuff…

Besides…freaking Ruskin was a Midevalist of all the damned things.


#7

If .profile doesn’t work, try
~/.bash_profile
The personal initialization file, executed for login shells


#8

hm… works for me:

  1. created .bashrc in my home folder with the simple content export BASH_TEST="bash test string". Nothing else.
  2. opened a terminal and launched bash
  3. in the bash session, ran env | grep BASH_TEST, got:
    BASH_TEST=bash test string
    
  4. My environment is i3wm, urxvt, tcsh

#9

Start “bash -l” or “bash --login”, then You see the difference.


#10

I have to time out on this, it looks like my Lenovo H340 disk controller is flaky - no way to fix but replace motherboard.

Be back later - perhaps I can get a non-slimline so I can have room and board !!!

J.


#11

We’ll miss You… So sad…


#12

Y, I think/hope I know the diff bw login and interactive shells :slight_smile: … and that’s one of the reasons ppl usually source .bashrc from .bash_profile. It’s all in that link I provided above. What’s strange is that after

which is sounded like OP started an interactive bash-shell which should’ve read their .bashrc :slight_smile:
anyway, whatever works is good.


#13

Graphical Terminals (the bash-shell’s parent) can be configured to start the shell contained within them as either login-shell or not.
We don’t know the OP’s GUI-Terminal’s Configuration.

For example, I always use xterm, and I always set its settings to start its shell-process as login-shell.


#14

Problem solved. Whatever it was, I need not worry cuz I just did an update and a .bashrc was automatically supplied and it’s working without me doing anything.

And…surprise !! I can read the directory names now in the command box, they’re in a nice readable blue, instead of purple.

I’m on an HP 15 laptop for now until I can get a new motherboard or computer. It didn’t recognize the wireless so I just connected a LAN cable to the mac, shared the internet connection and voilla (voila ?? I always forget if its’ one “L” or 2 in “voilla”.

Thanxing for the tips everyone.

J.