Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

bluemoon

macrumors member
Original poster
Aug 2, 2004
44
0
i was trying to use the sudo command in my terminal when i got this:

tcsh : sudo : command not found

is this normal? i really no idea.... thanks in advance.
 

yellow

Moderator emeritus
Oct 21, 2003
16,018
6
Portland, OR
No it is not.

Could be your path is FUBAR. Verify it by seeing if sudo is in /usr/bin, as it should be. If it is, show us what your path is:

echo $PATH
echo $shell

If it's not, then it sounds like you might have installed OS X and not installed BSD Subsystem. Use Pacifist to get that installer of your OS X CDs/DVDs.
 

bluemoon

macrumors member
Original poster
Aug 2, 2004
44
0
echo $path

/bin:/sbin:/usr/bin:/usr/sbin,/urs/local/bin

echo $shell

/bin/tcsh

erhmm... sorry..dun understand bout the FUBAR part and checkn the usr... where is that usr? anyway... was using it fine the other day... just tat i suddenly cant use it... i tried installing tinyfugue but din fully install it yet... and i accidentally moved the utilities folders to trash but took it out.. any idea wat's happening? or wat i can i do to salvage my situation?
 

bluemoon

macrumors member
Original poster
Aug 2, 2004
44
0
there's a comma after sbin isnt there?anyway... wat can i do to retify the problem?
 

yellow

Moderator emeritus
Oct 21, 2003
16,018
6
Portland, OR
Sorry, it was supposed to say should NOT be a comma.

Please verify the output of

echo $PATH

And make sure there's not a comma in there.

Do you have a .login or a .cshrc or a .tcshrc in your home directory?
 

bluemoon

macrumors member
Original poster
Aug 2, 2004
44
0
hmmm.. the one above is correct.. it does have a comma there... hmmm...sorry man, i am quite a hopeless person at the whole terminal thing... dont understand wat u meant by home directory.. sigh.... i guess i am in big trouble?
 

yellow

Moderator emeritus
Oct 21, 2003
16,018
6
Portland, OR
Before you start fiddling with UNIX and the command line, you should familerize yourself with it's workings. Here is a good starting place for a tutorial:

http://osxfaq.com/Tutorials/LearningCenter/index.ws


The home directory is your home folder, where your Documents, Pictures, Music, Movies, etc are. If you have a comma in your path, then that is why sudo doesn't work. Please post the results of:

ls -laF ~
 

blodwyn

macrumors 65816
Jul 28, 2004
1,147
1
Portland, Oregon
bluemoon said:
echo $path

erhmm... sorry..dun understand bout the FUBAR part

FUBAR = Fouled Up Beyond All Recognition

There's also SNAFU = Situation Normal, All Fouled Up

I believe there are alternatives based on another word that also begins with 'F' ;)
 

bluemoon

macrumors member
Original poster
Aug 2, 2004
44
0
somehow i feel as if i am threading into hell... well... i am at the next lower level of the pits now... ls: command not found...

i somehow think i am in serious trouble....

i gotta go sleep now.. sigh.... how can i contact u to ask with regards to this? or u can just post the method.. will be back tomorrow...
 

bluemoon

macrumors member
Original poster
Aug 2, 2004
44
0
drwxr-xr-x 17 admin staff 578 9 Sep 00:50 ./
drwxrwxr-t 7 root admin 238 6 Sep 13:15 ../
-rw-r--r-- 1 admin staff 3 31 Aug 00:38 .CFUserTextEncoding
-rwxr-xr-x 1 admin staff 6148 9 Sep 00:53 .DS_Store*
-rw-r--r-- 1 admin staff 0 19 Sep 2003 .MCXLC
drwx------ 11 admin staff 374 10 Sep 00:59 .Trash/
-rw-r--r-- 1 admin staff 33 3 Sep 13:07 .cshrc
drwx------ 3 admin staff 102 9 Sep 01:50 .irssi/
drwx------ 15 admin staff 510 10 Sep 00:58 Desktop/
drwx------ 7 admin staff 238 6 Sep 13:15 Documents/
drwx------ 35 admin staff 1190 10 Sep 01:08 Library/
drwx------ 3 admin staff 102 19 Sep 2003 Movies/
drwx------ 6 admin staff 204 3 Sep 23:13 Music/
drwx------ 4 admin staff 136 31 Aug 00:40 Pictures/
drwxr-xr-x 3 admin staff 102 3 Sep 23:40 PoisonDownloads/
drwxr-xr-x 4 admin staff 136 19 Sep 2003 Public/
drwxr-xr-x 5 admin staff 170 19 Sep 2003 Sites/

this?
 

tomf87

macrumors 65816
Sep 10, 2003
1,052
0
It is most likely in /etc/profile.. Open Terminal and run:

/usr/bin/sudo /usr/bin/open -a TextEdit /etc/profile

Check the PATH variable in it.. For yours, it should read:

/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin

NOT
/bin:/sbin:/usr/bin:/usr/sbin,/urs/local/bin


Then save the file if you had to change it.
 

stcanard

macrumors 65816
Oct 19, 2003
1,485
0
Vancouver
bluemoon said:
somehow i feel as if i am threading into hell... well... i am at the next lower level of the pits now... ls: command not found...

i somehow think i am in serious trouble....

Nahh, it's all because your $PATH has been messed up. Fast fix from the terminal would be:

set PATH = /bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin

(My tcsh is rusty, you might need to use setenv)

that will fix that specific terminal session so the commands can be found.

Then you need to open the files listed above and fix the path.
 

bluemoon

macrumors member
Original poster
Aug 2, 2004
44
0
i did the /usr/bin/sudo /usr/bin/open -a TextEdit /etc/profile

and got this for my path:"/bin:/sbin:/usr/bin:/usr/sbin"

so do i still edit till it becomes : /bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin ?

tried the fast fix : set PATH = /bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin but nothing happened... thanks for all the help... i am like a noob to all this programming thing... really appreciate all you ppl...:)
 

mms

macrumors 6502a
Oct 8, 2003
784
0
CA
The usual disclaimer:
Don't use sudo unless you know what you're doing.

I would go educate myself with at least the basics of the command line before using sudo as you can seriously screw up your system that way.
 

stcanard

macrumors 65816
Oct 19, 2003
1,485
0
Vancouver
bluemoon said:
i did the /usr/bin/sudo /usr/bin/open -a TextEdit /etc/profile

and got this for my path:"/bin:/sbin:/usr/bin:/usr/sbin"

so do i still edit till it becomes : /bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin ?

tried the fast fix : set PATH = /bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin but nothing happened... thanks for all the help... i am like a noob to all this programming thing... really appreciate all you ppl...:)

Hmm, sounds like you might have a personal file messing it up:

try

/usr/bin/open -a TextEdit ~/.profile

(notice the "." in front of the name there)

And see if there is a line in there that modifies the path. you need to do two things:

1) Change that comma into a colon ":"
2) Change the /urs at the end into a /usr
 

tomf87

macrumors 65816
Sep 10, 2003
1,052
0
stcanard said:
Hmm, sounds like you might have a personal file messing it up:

try

/usr/bin/open -a TextEdit ~/.profile

(notice the "." in front of the name there)

And see if there is a line in there that modifies the path. you need to do two things:

1) Change that comma into a colon ":"
2) Change the /urs at the end into a /usr

From the directory listing above, it appears there isn't a .profile. There is a .cshrc however, so I'd check there.

/usr/bin/open -a TextEdit ~/.cshrc
 

stcanard

macrumors 65816
Oct 19, 2003
1,485
0
Vancouver
tomf87 said:
From the directory listing above, it appears there isn't a .profile. There is a .cshrc however, so I'd check there.

/usr/bin/open -a TextEdit ~/.cshrc

Told you my tcsh was rusty. I've been a bash person for a long time. (I also apparently don't read very well)

Come to think of it, you should also check /etc/csh.login and /etc/csh.cshrc -- I assume tcsh uses those?
 

bluemoon

macrumors member
Original poster
Aug 2, 2004
44
0
typed /usr/bin/open -a TextEdit ~/.cshrc and got this:

set path=($PATH,/urs/local/bin)

typed /etc/csh.login and got permision denied.

typed /etc/csh.cshrc oso has permission denied.

yet to edt anything cos i dun noe wat to edit..
 

yellow

Moderator emeritus
Oct 21, 2003
16,018
6
Portland, OR
bluemoon said:
set path=($PATH,/urs/local/bin)

There's your problem. It should be:

$PATH:/usr/local/bin

Colon, not comma. Change that and open Terminal and all will be correct. IMO, declaring path is much better to do in a ~/.login. Read that UNIX tutorial.

bluemoon said:
yet to edt anything cos i dun noe wat to edit..

edIt BEcAUsE I dON'T KnoW wHat
 

bluemoon

macrumors member
Original poster
Aug 2, 2004
44
0
oops... sorry for that lazy english.. now i got this after editing it....

tcsh: Bad : modifier in $ (/)

hmmm.... now what do i do with this message? i get it everytime i log in now...sigh... thanks for helping :)
 

yellow

Moderator emeritus
Oct 21, 2003
16,018
6
Portland, OR
Sorry, my fault there..

Edit that file again.

change it to:

set path = ($PATH /usr/local/bin)

Open Terminal. Verify that it's working with:

echo $PATH

It should look like this:

Code:
yellow% echo $PATH
/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin
 

yellow

Moderator emeritus
Oct 21, 2003
16,018
6
Portland, OR
Personally, I would prefer that you take the whole path declaration out of your .cshrc and put it in a .login, thusly:

setenv PATH "/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin"
 

bluemoon

macrumors member
Original poster
Aug 2, 2004
44
0
thanks a million Yellow...u saved me.... and my baby mac..:) hee... think everything should be fine now... don't quite understand about the .login though... wat am i supposed to do? create a new file or just type in that command : setenv PATH "/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin" ?
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.