SCIENTIFIC-LINUX-USERS Archives

January 2017

SCIENTIFIC-LINUX-USERS@LISTSERV.FNAL.GOV

Options: Use Monospaced Font
Show Text Part by Default
Show All Mail Headers

Message: [<< First] [< Prev] [Next >] [Last >>]
Topic: [<< First] [< Prev] [Next >] [Last >>]
Author: [<< First] [< Prev] [Next >] [Last >>]

Print Reply
Subject:
From:
Lionel Guy <[log in to unmask]>
Reply To:
Lionel Guy <[log in to unmask]>
Date:
Thu, 26 Jan 2017 14:30:07 +0100
Content-Type:
text/plain
Parts/Attachments:
text/plain (60 lines)
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 <[log in to unmask]> 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: [log in to unmask] | mobile: +46 (0)73 9760618 | phone: +46 (0)18 410 7398

ATOM RSS1 RSS2