Hello,
I am running Linux Mint 17.3 Cinnamon 64-bit. There are three accounts defined. One of these has an environment variable SHELL defined as /bin/bash. The other two don't have this variable set.
This causes a dircolors warning message when starting a terminal, which is not a big problem.
A big problem is that the Android emulator can not be run from Android Studio, because without the SHELL variable the emulator thinks it is running on a 32-bit system.
I checked the accounts. The don't have a .bashrc file. They have identical .pam_environment and .profile files.
What is setting the SHELL variable in one account (or what is unsetting it in the other two accounts)?
[Solved] bash SHELL environment variable not set
Forum rules
Topics in this forum are automatically closed 6 months after creation.
Topics in this forum are automatically closed 6 months after creation.
[Solved] bash SHELL environment variable not set
Last edited by LockBot on Wed Dec 28, 2022 7:16 am, edited 3 times in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
Regards,
George
Linux Mint 21.2 Victoria Cinnamon 64-bit, Asus Vanguard B85, Intel Core i7 4770S
George
Linux Mint 21.2 Victoria Cinnamon 64-bit, Asus Vanguard B85, Intel Core i7 4770S
Re: bash SHELL environment variable not set
From the bash manpage:
I don't know how it would be empty.
Code: Select all
SHELL The full pathname to the shell is kept in this environment vari‐
able. If it is not set when the shell starts, bash assigns to
it the full pathname of the current user's login shell.
Re: bash SHELL environment variable not set
Two questions:
1. How did you create the additional user accounts?
2. How are you determining that the $SHELL environment variable is not set?
1. How did you create the additional user accounts?
2. How are you determining that the $SHELL environment variable is not set?
Re: bash SHELL environment variable not set
@LinuxJim
@xenopeek
As I can not find a file that sets the environment variable, I assume bash has set it. But why this doesn't happen (or is undone by something else) in the accounts I made later?
- As far as I remember I used the adduser command.
- The command gives SHELL= for the account which has the problem, and SHELL=/bin/bash for the other account.
Code: Select all
env | grep -i shell
@xenopeek
As I can not find a file that sets the environment variable, I assume bash has set it. But why this doesn't happen (or is undone by something else) in the accounts I made later?
Regards,
George
Linux Mint 21.2 Victoria Cinnamon 64-bit, Asus Vanguard B85, Intel Core i7 4770S
George
Linux Mint 21.2 Victoria Cinnamon 64-bit, Asus Vanguard B85, Intel Core i7 4770S
Re: bash SHELL environment variable not set
Check your /etc/passwd file. It has a line for each user (also system users) and notes their default shell. The first field has the username, the last field the location of the default shell. You can do
grep username /etc/passwd
to quickly find the line for a username (replace "username" with the username you want to look up).Re: bash SHELL environment variable not set
That's it. The two accounts that had the problem did have no default shell specified (although they were using bash according to the output of ps $$). Adding /bin/bash solved the problem.
Thank you very much!
Thank you very much!
Regards,
George
Linux Mint 21.2 Victoria Cinnamon 64-bit, Asus Vanguard B85, Intel Core i7 4770S
George
Linux Mint 21.2 Victoria Cinnamon 64-bit, Asus Vanguard B85, Intel Core i7 4770S
Re: bash SHELL environment variable not set
Sorry I didn't get back to you sooner, but it looks like xenopeek pointed you in the right direction.gwi wrote:@LinuxJimThe account that has the environment variable set is the account made during install. The two accounts I created later do not have the variable set.
- As far as I remember I used the adduser command.
- The command
gives SHELL= for the account which has the problem, and SHELL=/bin/bash for the other account.Code: Select all
env | grep -i shell
'adduser' has a command line option to set up the defaults for a new account. If you don't use that option, or you don't explicitly set the shell for that account with another option (see 'man adduser'), it doesn't get set in the passwd file.