Operating System - HP-UX
1834461 Members
3159 Online
110067 Solutions
New Discussion

Re: Can I remove .exrc from all user in the system

 
Sonny_8
Occasional Advisor

Can I remove .exrc from all user in the system

Hi all

I plan to remove .exrc from all users in may system.
Is there any issue to do that?
It seem to be this file contain key mapping.
what is the impact of delete?


Regards
Sonny
Sonny
Timezone id
6 REPLIES 6
Ravi_8
Honored Contributor

Re: Can I remove .exrc from all user in the system


Hi, Sonny

to verify, i have deleted .exrc files of some users, users are not complaining anything.
never give up
Ralph Grothe
Honored Contributor

Re: Can I remove .exrc from all user in the system

Why do you want to do that?

Since the dot files in the users' home directories usually contain personal configurations and adaptions for all kinds of system programs that the users may have invested a lot of effort in,
I would consider it a little rude to remove these files as root without asking for confirmation.

The .exrc is the user's config file for the ex editor (which also is a subset of vi).
In it users can put their own settings (those that a "set all" shows in vi on the ex-mode line), as well as macros aka map definitions.
Madness, thy name is system administration
John Strang
Regular Advisor

Re: Can I remove .exrc from all user in the system

Hi Sonny,

I would leave them where they are. They should not be taking up much space, and although some users may not even notice if you removed them, some people might be annoyed to lose their personal editor settings.

Just my opinion,

JOhn
If you never make a mistake you'll never make anything.
Bill Hassell
Honored Contributor

Re: Can I remove .exrc from all user in the system

You can remove them and the users can put them back with by creating their own or copying the default version from /etc/skel or /usr/newconfig/etc/skel. Is there a reason you want to remove this personal preference file? vi can be a lot easier to use when typical preferences are setup (things like ignorecase, nows and showmode).


Bill Hassell, sysadmin
Scott Corzine
Advisor

Re: Can I remove .exrc from all user in the system

I agree that this is a good way to annoy users, and probably shouldn't be done. But I can think of two reasons you might want to remove or replace specific .exrc files:

(1) You want to remove those .exrc files which are exact copies of the original (presumably to make newer parameters available). By using diff in a loop you can affect only those files:

while read userdir
do diff /etc/skel/.exrc $userdir/.exrc && rm $userdir/.exrc
done

This will keep those people who have customized their .exrc happy.

(2) You want to remove/rename all .exrc files which contain some specific problem pattern (I don't know what that would be), so grep comes into the game:

while read userdir
do grep 'Bad Line' $userdir/.exrc && mv $userdir/.exrc $userdir/.exrc.old
done

Hopefully you won't need either of these, but they're somewhat less distructive than going after everything.


-Scott-
Shannon Petry
Honored Contributor

Re: Can I remove .exrc from all user in the system

the .exrc file is read mostly by the VI editor. Those key mappings allow certain functionality, and enable some very friendly features in vi.

Since .exrc is not used by anything except the editors, they really pose no threats to security that I can see. If you fear that a user has a bad .exrc or the .exrc file is causing problems with vi, then copy the system shipped default from /etc/skel/.exrc to the users home directory.

Regards,
Shannon
Microsoft. When do you want a virus today?