After modifying .cshrc file, ls: Command not found


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers After modifying .cshrc file, ls: Command not found
# 1  
Old 06-04-2010
After modifying .cshrc file, ls: Command not found

I am using Redhat 4.1.2, tcsh shell

To add a program to my path, I added the following line to my .cshrc file:
Code:
set path = (/home/R/R-2.11.0/bin/ /home/R/R-2.11.0/library)

It worked, I am able to run the program I wanted. But the pathway above overwrote all other existing paths - so I can no longer open emacs, vi, xclock, or use commands I was previously able to implement like: ls or pwd

I get the error - ls: Command not found.

I messed up big time! Since I can't open emacs I don't how to edit the .cshrc file. How can I reverse all of this?

Last edited by Yogesh Sawant; 06-07-2010 at 03:19 AM.. Reason: added code tags
# 2  
Old 06-04-2010
If your .tcshrc was not modified, then just close your session and login again. Smilie

Code:
set PATH = ($PATH home/R/R-2.11.0/bin/ /home/R/R-2.11.0/library)

Otherwise you can create a temp user with the default $PATH and use the newly created .tcshrc

In RHEL it's usually something like:
Code:
/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:

 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Assistance with my Find command to identify last part of a file name and report the name found

Hello Forum, We have two bootstraps of Chef in our environment which are identified by colour: /var/chef/cache/cookbooks/bootstrap_cookbooks_version_green and /var/chef/cache/cookbooks/bootstrap_cookbooks_version_red I'm attempting to identify which version is installed based on the name... (11 Replies)
Discussion started by: greavette
11 Replies

2. Shell Programming and Scripting

Modifying bash script to take each line in a file and execute command

I need to modify a bash script to to take each line in a file and execute command. I currently have this: #!/bin/bash if ; then echo "Lipsa IP"; exit; fi i=1 ip=$1 while ; do if ; then rand=`head -$i pass_file | tail -1` user=`echo $rand | awk '{print $1}'` pass=`echo $rand | awk '{print $2}'`... (3 Replies)
Discussion started by: galford
3 Replies

3. Shell Programming and Scripting

Modifying file from command line using Perl

Hi all, I am having a slight issue updating a file using perl from the command line I need some help with. The item is: DATA_FILE_TYPE=FULL When I run the below command /usr/bin/perl -p -i -e "s/DATA_FILE_TYPE=/DATA_FILE_TYPE=APPEND/g" processfile.cfg It looks to be... (2 Replies)
Discussion started by: kstevens67
2 Replies

4. Shell Programming and Scripting

Source.cshrc file inside Perl

I have a file which is basically .cshrc It contains lines such as: setenv <variable> <value>... set path=(<dir> <dir>) source <another_file>... (1 Reply)
Discussion started by: kshitij
1 Replies

5. Shell Programming and Scripting

Modifying the cd command

Hello everyone, I am currently doing a utility that acts like a cd command but keeps track of your change of directories. What I plan to do is just to modify the cd source code, is that even possible? Can someone please help me with this? I also need to incorporate the command with the... (3 Replies)
Discussion started by: iennetastic
3 Replies

6. Shell Programming and Scripting

alias defining problem in .cshrc file

Hi folks, I'm trying to define the following command as alias in .cshrc file: ls -ltr | grep ^d | awk '{print $9}' | xargs du -hs I defined it as the following: alias nirdirs '`ls -ltr | grep "^d" | awk "{print \\$9}" | xargs du -hs`' I've got the following error when I've run the alias:... (7 Replies)
Discussion started by: nir_s
7 Replies

7. Virtualization and Cloud Computing

.cshrc file

Hi All, I was hoping someone could help me with the following query I have please in relation to NX Nomachine. Is there a way to get my .cshrc file in say my “US” home dir” to run when I login to another server e.g say a UK server? Any advise would be much appreciated, thanks (3 Replies)
Discussion started by: zainster
3 Replies

8. Shell Programming and Scripting

Help with find command and list in a long format each found file

The purpose of those comands are to find the newest file in a directory acvrdind to system date, and it has to be recursively found in each directory. The problem is that i want to list in a long format every found file, but the commands i use produce unexpected results ,so the output lists in a... (5 Replies)
Discussion started by: alexcol
5 Replies

9. Shell Programming and Scripting

how can i check in csh if command found or not found ?

hello all im trying to use in sun Solaris the information received from the top command now i several machines that dont have install the top program so when im running the script im geting error saying after im running this code : set MemoryInfo = `top | grep Memory` if (... (2 Replies)
Discussion started by: umen
2 Replies

10. UNIX for Dummies Questions & Answers

How to set the CVSROOT in the .cshrc file?

I am learning the CVS in Unix now, but in the book it said I need to add the CVSROOT to the end of the .cshrc file. I had use emacs to edit it and add CVSROOT=/CVS, but when I run script .cshrc then it said CVSROOT=/CVS: Command not found. I had already think that for a hour, so could any person... (1 Reply)
Discussion started by: a8111978
1 Replies
Login or Register to Ask a Question