0

I occasionally have to re-install operating systems on the various linux machines which I manage. Every time I do this, I have to copy the .bashrc file to a USB drive before wiping the old system, and then put it back after I've installed a new system. (And perhaps edit it if something is no longer compatiable.)

This is annoying, and I usually stick to one version of a Linux OS and install it on most of my machines, so I've been trying to store my .bashrc content in a new file inside my Dropbox folder.

For example, I have put HISTTIMEFORMAT="%F %T " in a file named mybash inside my Dropbox folder.

What do I need to put inside my .bashrc file to "load all the stuff from the mybash file"?

I tried this, but it didn't seem to work?

# Load bash custom files
if [ -f /home/user/Dropbox/mybash ]
then
    . /home/user/Dropbox/mybash
fi
user3728501
  • 3,404
  • 9
  • 39
  • 54

2 Answers2

0

I fixed the problem using some info found here.

Menu -> Edit -> Preferences -> General -> Tick the box: run as login shell

Thanks to AnythingIsFine for pointing me in the right direction.

This is an XFCE Terminal specific solution.

user3728501
  • 3,404
  • 9
  • 39
  • 54
-1

Are you sure that the user which is sourcing the .bashrc file has permsission to read from:

. /home/user/Dropbox/mybash

Users can't read from one another's home dirs, unless specifically configured to do so.

The real reason might be because you are missing your

~/.bash_profile

file which sources your

~/.bashrc

where you finally instructed to source your mybash file.

You should add your code to the:

~/.bash_profile

instead.