[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 338
  • Last Modified:

Linux bash profile

Hello,
I am working on a remote data center that had linux with default of kshell. When I swap to bash it does not pick up the bash profile but using only the .profile (and therefor does not use aliases for example). Can you advice what is missing in the configuration?
Thank you.
0
tamirmilo
Asked:
tamirmilo
  • 3
  • 2
  • 2
  • +4
3 Solutions
 
Hugh McCurdyCommented:
For starters, what file name did you use for the bash profile?  I use .bash_profile in the home directory (  ~/.bash_profile ).
0
 
Hugh McCurdyCommented:
If the file name is correct, does the logging in user have read access to the file?
0
 
Kerem ERSOYPresidentCommented:
Hi,

How do you swap to bash ??

You can execute the command file such as this:

. script_file

Please note that there is one dot then a blank then the name of file you want to execute. This will cause the script file be evaluated on the current shell

Cheers,
K.

0
Prepare for your VMware VCP6-DCV exam.

Josh Coen and Jason Langer have prepared the latest edition of VCP study guide. Both authors have been working in the IT field for more than a decade, and both hold VMware certifications. This 163-page guide covers all 10 of the exam blueprint sections.

 
woolmilkporcCommented:
You're missing in your .profile

export ENV=~/.bash_profile

or whatever the name of the missing profile is (instead of .bash_profile).

wmp
0
 
TintinCommented:
If you are swapping shells by typing in

bash

Open in new window


that won't pick up your profile.

Do
bash -l

Open in new window


instead
0
 
omarfaridCommented:
adding to Tintin's comments:

When an interactive shell that is not a login shell is started, Bash reads and executes commands from ~/.bashrc, if that file exists.

You may copy to ~/.bashrc contents of .profile or create a hard link.

cd
cp .profile .bashrc

OR

cd
ln .profile .bashrc
0
 
tamirmiloAuthor Commented:
Thanks guys. I will check that on Monday
0
 
tamirmiloAuthor Commented:
I swap to bash by just typing bash..
I want to change the bash to the default profile any way...
0
 
woolmilkporcCommented:
usermod -s /bin/bash userid

(as root)

wmp
0
 
xtermCommented:
You can run 'chsh' as the user in order to change your default shell.

BTW, you can see what standard profile names bash looks for by doing this:

[myuser@home ~]$ strings /bin/bash | grep profile
/etc/profile
~/.profile
~/.bash_profile

As you can see, it will look in each of those places and source all that exist when you log in (or simply type "bash" to change from another shell)
0
 
tamirmiloAuthor Commented:
Thank you.
0

Featured Post

Veeam and MySQL: How to Perform Backup & Recovery

MySQL and the MariaDB variant are among the most used databases in Linux environments, and many critical applications support their data on them. Watch this recorded webinar to find out how Veeam Backup & Replication allows you to get consistent backups of MySQL databases.

  • 3
  • 2
  • 2
  • +4
Tackle projects and never again get stuck behind a technical roadblock.
Join Now