0

I am on a RedHat csh. I just modified ~/.cshrc with a wrong path and resulting in an syntax-error. my shell just not recognize ls or gedit. So, when I again try to modify, it is not again opening with gedit ~/.cshrc.

When I boot the system it is not starting the profile.
I Have the root access and root profile is fine. Can I edit it from root. Please help me to remove last two lines i have added to /.cshrc, using root-profile so that it works normal as previous.

thanks.

diffracteD
  • 758
  • 3
  • 10
  • 32
  • You could just rename it using `mv`. – larsks Apr 16 '14 at 16:34
  • sorry! bt i dont understand. please explain a bit. I need the whole .cshrc profile except the last two lines. – diffracteD Apr 16 '14 at 16:34
  • 1
    You can rename your `.cshrc` file so that it is no longer executed. Then start a new shell, and everything should be fine. YOu can edit the file and then rename it back to `.cshrc`. – larsks Apr 16 '14 at 16:36
  • it it possible to edit it from root profile .!? @larsks – diffracteD Apr 16 '14 at 16:46
  • 1
    Yes, it is possible to edit it from the root account. When you log in as root, do you get a graphical environment or are you at the console? If graphical, you can use `gedit /home//.cshrc`. Replace `` with the name of the user that is having the problem. – esorton Apr 16 '14 at 17:48

1 Answers1

3

I'm guessing your PATH isn't getting set properly due to the syntax-error in your .cshrc (assumption since you mention ls isn't working). Try the following from your shell:

 echo $PATH

echo is a built-in and should always work. If it returns nothing, is empty, or doesn't include a list of paths similar to /bin, /usr/bin, etc ... then your path is indeed incorrect. Use the full path to gedit on the command line like:

/usr/bin/gedit ~/.cshrc
esorton
  • 1,562
  • 10
  • 14