# A problem with editors and shells



## imp (Jun 18, 2010)

I ran the chsh command as root to change the shell and editor for root. i then made a stupid mistake and replace my shell with the editor i wanted and the editor with the shell so now whenever i login as root it starts emacs. i realize that this is a stupid mistake. now i need to know where the file with the shell and editor information is. because i should be able to simply edit the file with the root power emacs i have open but i have no idea where it is. thanks in advance for helping me with my stupid blunder


----------



## SirDice (Jun 18, 2010)

imp said:
			
		

> I ran the chsh command as root to change the shell and editor for root.


Do NOT change root's shell!



> i then made a stupid mistake and replace my shell with the editor i wanted and the editor with the shell so now whenever i login as root it starts emacs. i realize that this is a stupid mistake. now i need to know where the file with the shell and editor information is. because i should be able to simply edit the file with the root power emacs i have open but i have no idea where it is. thanks in advance for helping me with my stupid blunder


I don't use emacs that often but I'm sure emacs can spawn a shell. Use that shell to change root's shell back to /bin/csh. If that fails, boot to single user mode to change the shell.

The 'editor' being used is just an environment variable (EDITOR). Change it in ~/.cshrc.


----------



## gall0ws (Jun 18, 2010)

From emacs just type: 
[cmd=""]M-x eshell[/cmd]

Then inside eshell: `# chsh -s /bin/csh`


----------



## imp (Jun 18, 2010)

Yes i realized my mistake in changing the shell after looking more into it and was in the middle of changing it back. It would appear that in changing the shell i changed what emacs accesses so it can no longer open a shell that operates properly. it would seem that i need a crash course in SUM. Thank you for all your help.


----------

