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

Re: automatic root shell initialization



* Derrick 'dman' Hudson (dman@dman13.dyndns.org) [030624 10:56]:
> On the ("new") debian server at work, my boss wants bash to be in
> 'emacs' mode when he su's to root.  I work with 'vi' mode, however.
> Is there some way for the .bashrc to recognize whether he su'd to root
> or I did and set the editing mode appropriately?

Something like this should work.

~/bin/mysu : 
#!/bin/sh
su -c 'bash --init-file ~/.bashrc-dman' -

/root/.bashrc-dman :
set -o vi

good times,
Vineet
-- 
http://www.doorstop.net/
-- 
"Computer Science is no more about computers
than astronomy is about telescopes."  -- E.W. Dijkstra

Attachment: signature.asc
Description: Digital signature


Reply to: