![]() |
tcsh funkiness
what happened here?
Welcome to Darwin! tcsh_initdir: Undefined variable. > anybody know? thanks!! it's not a huge deal, because i'm using bash, but i'm curious... :D |
i suspect that bash is running through your startup scripts and one of these contains references to, or directly calls, the tcsh init scripts in your home dir.
check ~/.profile and for your bash startup scripts calling a tcsh startup script. read the bash man pages about verbose mode open a new terminal window and $ exec bash -v perhaps that will uncover the problem script. let us know. |
um... no, sorry.
nice thought... but no cigar.
sorry, i didn't mention that the reason i installed bash was because of this strange "tcsh_initdir undefined" thing. verbose execution of bash yields nothing. also, i don't seem to have a .profile... is that bad? thanks! |
i suspect that you may have installed bash, but are still running a fractured tcsh installation in the terminal app.
show us some more info show us the result of these commands: > echo $version > echo $SHELL |
i've got both installed...
bash2.05 lancelot@localhost ~ % echo $version
bash2.05 lancelot@localhost ~ % echo $SHELL /bin/tcsh there 'tis. one more thing: i know i've got both installed. but... i want to be able to switch between them without a big deal. when i tell Terminal to use tcsh, i get the tcsh_initdir undefined thing. bash works fine. make any sense? |
o i c
i thought you were running bash and getting the tcsh_initdir error. sheesh. you have a fractured tcsh installation. read and follow the instructions in the readme from the tcsh init bucket % ll /usr/share/init/tcsh/ total 40k -rw-r--r-- 1 root wheel 952 Sep 2 20:35 README -rw-r--r-- 1 root wheel 892 Sep 2 20:35 aliases -rw-r--r-- 1 root wheel 9.4k Sep 2 20:35 completions -rw-r--r-- 1 root wheel 433 Sep 2 20:35 environment -rw-r--r-- 1 root wheel 701 Sep 2 20:35 login -rw-r--r-- 1 root wheel 395 Sep 2 20:35 logout -rw-r--r-- 1 root wheel 1.9k Sep 2 20:35 rc -rw-r--r-- 1 root wheel 2.3k Sep 2 20:35 tcsh.defaults |
am i that confusing? ;)
<sigh> that came really close, but no dice...
i read the README and configured tcsh back... i now have aliases.mine completions.mine environment.mine rc.mine path in ~/Library/init/tcsh also, it sucessfully made ~/.tcshrc, ~/.login, and ~/logout. yet... it still does this when i try to run tcsh as the main shell in Terminal: tcsh_initdir: Undefined variable. > heh.. on a sidenote, i just noticed that if you don't select "Use Default Shell" in the Terminal prefs, it doesn't say "Welcome to Darwin!" hm. anyhoo... any clearer? or still mud? thanks for your time! |
okay, let's look at this then...
Code:
% ll /etc/csh*if it does look like this, then we need to find where the ref to tcsh_initdir poops out. try % exec tcsh -V and follow this up to where the undefined error is and let us know. BTW, the last part of this could get very long because it processes your command history file, so page up to the beginning of -V run and follow from there. |
quick question
is it bad if i don't have a csh.cshrc? :(
|
urp!
yep. well, er, no, not bad qua bad, but it's problematic if you want tcsh to work well. here are the ownership, permissions, and contents of csh.cshrc Code:
% ll /etc/csh.cshrc that should get you started at solving this problem. let us know how you do. |
difficulty
ok, i made the file... but i used the GUI to c&p the contents of rc into it... and now it's 1960 bytes... whereas yours says 31...
'scuse my newbiness: what's cat and source do? i tried doin what you showed in our code, but it didn't quite work. is that line break s'posed to be there? btw, the top of my rc file looks the same as yours. i think we're gettin close... |
mm'k...
alright, now that i have a csh.cshrc file... and it looks exactly like the tcsh/rc file... when i try to run tcsh i get this:
[Process was terminated by signal 11] any ideas? |
Re: difficulty
something's wrong with 1960 bytes.
read thru all of this first and try these things: Code:
% unset noclobberwhat GUI editor did you use? cat = concatenate files and print to standard output, that is, display file contents source = tcsh's builtin command to tell the shell to read and execute commands in a file you can read documentation about commands in the infamous man pages % man cat % man tcsh i don't know which line break you're referring to, alas. sudo - execute command as other user echo - write args to stdout chmod - change access modes (permissions) chown - change owner:group okay, now dig into those man pages |
Re: mm'k...
Quote:
will spit back every line the shell executes. the last one may have caused your sigterm 11. some shell startup code is protected and it must run without error or die hard. what you got is the die hard scenario. at this point, you need to get that /etc/csh.cshrc proper, then we can approach the remaining issues |
what in the world?
bash2.05 lancelot@localhost ~ % unset noclobber
bash2.05 lancelot@localhost ~ % sudo echo "source /usr/share/init/tcsh/rc" > /etc/csh.cshrc bash: /etc/csh.cshrc: Permission denied this is most odd. thanks for the explanations of the commands... i asked before i thought to do a "whatis" on 'em, or a man lookup. :D i'm slowly but surely gettin the hang of this UNIX shtuff... thanks very much for your patience. do you use AOLIM? that might be faster... if you want to. my s/n is scapegoat51 (it's in my profile, of course, but i figure those extra clicks can be put to better use elsewhere ) |
hmm..
does this look like an endless loop to you? goto:
http://www.bonnvie.com/~lroggy/shtuff/tcshoutput.txt that's what i got when i did exec tcsh -V. not sure what that tells us, but... |
re: AOLIM, um, no
sorry, i can't seem to perform that sudo echo either. i don't understand that. and i want to emphasize this important point: test your code, and don't trust any given to you until you consider what it does. so, use pico to edit that /etc/csh.cshrc % sudo pico /etc/csh.cshrc control-k (kill) all lines in that file and paste in this: source /usr/share/init/tcsh/rc control-x to quit, answer yes to the save prompt then be sure to chmod, chown that puppy (sudo'd of course) then open a new terminal (command-n) window and % exec tcsh boy, that sure is wonky. i regret that this has been wonky for you. i'll try and find why that echo redirect (>) is so wonky. your humble wonker, -mt |
Re: hmm..
Quote:
BUT, this is a good excersise for sleuthing and using some common commands. let's keep digging. get that csh.cshrc script correct, then we can proceed. it should look like this when you're done Code:
|
ah, the smell of miscommunication in the morning...
ok, i understand things better now.
first, i thought csh.cshrc was supposed to be an exact duplicate of tcsh/etc. little did i know... so, that's fixed. now my csh.cshrc file is right. however... it's still dropping out with a sigterm 11. (whatever that means...) also, to answer your earlier question about GUI text editors: i use BBEdit 6.1 Lite. and all i did was use "open [pathto rc]" to open that folder in the Finder, and then opened rc in BBEdit, then c&p'd it to pico. which, as i know see, was not what you were tryin to get me to do. :D trial and error... |
for some reason, the permissions of the target needed to be group:write to echo to a root:wheel owned file. i don't understand that.
Code:
% sudo chmod g=r foo |
| All times are GMT -5. The time now is 10:35 PM. |
Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.
Site design © IDG Consumer & SMB; individuals retain copyright of their postings
but consent to the possible use of their material in other areas of IDG Consumer & SMB.