Dear Shane,

Thanks for your suggestion, it makes sense. I maybe need to explore it a bit 
further, but so far I’ve not had much success. Trying this in the shell where 
these aliases did not work:

$ shopt | grep aliases
expand_aliases  on

On top of that, aliases that are defined in ~/.bashrc are actually working in 
all situations

I tried explicitly stating:

$ shopt -s expand_alisases

either in the shell or in /etc/profile, that didn’t work.

I also tried to move alias definitions in /etc/bashrc, to no avail.

I look at all the different shopt options, and there are two that are 
differently set in the shells where it works/doesn’t work are 

extglob
hostcomplete

But I don’t see how these might make a difference. I anyway tried to set them 
on/off explicitly in ~/etc/profile, but that didn’t work either.

I also tried to find a comprehensive guide of what happens when one logs in 
(which files are read, in what order, etc) but didn’t really got anything 
satisfying. Anyone who has a good suggestion?

Cheers,

Lionel



> On 26 Jan 2017, at 13:16 , Shane Voss <[email protected]> wrote:
> 
> Dear Lionel,
> 
>> I have aliases defined in .sh files in my /etc/profile.d/ folder. When I log 
>> in on my computer directly in either KDE or Gnome, in any terminal (I tried 
>> Konsole, x-term and a few others), these aliases are not working (not set, I 
>> assume). Other commands in the same .sh files (like additions to $PATH) work 
>> fine.
>> 
>> When I log in with the same user through ssh, or directly on the computer on 
>> a text console (I don’t know how these are called: you access them through 
>> alt+ctrl+2 for example), or with another user in Gnome or KDE, the aliases 
>> work again.
> 
> The  man  page for bash says:
> 
>       Aliases  are not expanded when the shell is not interactive, unless the
>       expand_aliases shell option is set using shopt (see the description  of
>       shopt under SHELL BUILTIN COMMANDS below).
> 
> It looks to me as if some of your shells do not think they are interactive.
> 
>   Shane
> -- 
> Shane Voss, Computing Officer, School of GeoSciences, University of Edinburgh
> 
> The University of Edinburgh is a charitable body, registered in
> Scotland, with registration number SC005336.
> 

--
Lionel Guy 
Rimbertsvägen 10C SE-75260 Uppsala | email: [email protected] | mobile: +46 
(0)73 9760618 | phone: +46 (0)18 410 7398

Reply via email to