[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: bash colors the Right Way?



On Tue, Feb 15, 2005 at 03:21:21PM -0800, Peter Sebastian Masny wrote:
> Hi all,
> 
> Is there a good way to change bash settings for all logins?
> 
> I like to use ls --color=auto, and I login as different users, so what I 
> have done in the past is create an executable file called 
> /etc/shellstart which contained:
> alias ls='ls --color=auto'
> and in /etc/profile and /etc/bash.bashrc i added
> . /etc/shellstart
> 
> This works exactly as I want, but every time /etc/profile or 
> /etc/bash.bashrc is updated (which is actually not that uncommon) I 
> would install the new file and then add my ". /etc/shellstart".
> 
> All in all it is cludgy and a PITA, so I was wondering if there was a 
> better, more correct way to do this.
There is no global startup script that is executed for all types of
shells. /etc/profile is only read by login shells, and /etc/bash.bashrc
is only read by bash (login and not-login), so what you're doing is
probably the best way. I would include the shellstart file only once,
so a bash login shell wouldn't execute it twice (and probably complain
about setting already-set aliases, functions etc.)...

The only other solution I see is to modify (or create, if it doesn't
exist yet) /etc/skel/.bashrc and then propagate the changes made there
to all existing accounts. Newly created accounts will then get the
modified (i.e. shellstart-including) .bashrc. The necessary amount of work
to accomplish this mainly depends on the diversity of ~/.bashrc files your
users have at the moment...

HTH,

Jan

-- 
Jan C. Nordholz
<jckn At gmx net>

Attachment: signature.asc
Description: Digital signature


Reply to: