|
|
#1 |
|
Moderator
Join Date: Jan 2002
Location: Singapore
Posts: 4,237
|
mervTormel and pmccann please advice...
Setting up the environment:
I just wrote in Unix Beginners, "Terminal mods" thread: ------------------------------------------ << After installing, to add the XFree86 directory to our path, we create a path file in ~/Library/init/tsch If you have fink installed and created a .cshrc file with "source /sw/bin/init.csh" and then you create a .tcshrc and write your tip, you will loose fink: "sudo fink list: command not found" Now, will the average unix newbie know how to properly merge the required changes into his .tcshrc ? I read an interesting thread about this: http://sourceforge.net/mailarchive/m...?msg_id=242403 Please advice...thanks!>> ------------------------------------------- Please, could you read the above thread and advice what is the best way to go ? What is most interesting for me is the following: >So as I see it this is mainly to work around a problem that newbies >have if something installed a .tcshrc file for them. If they don't >have one, .cshrc works fine. >Your suggestion only has any effect if they have one. So, they have >one... and edit it... and see, it already has content. Now, will the >avarage unix newbie know how to properly merge the required changes >into his .tcshrc ? I don't think so. Hence we need to provide a >description etc. It just ain't that easy as you claim ![]() > >So I see various possibilities: > >1) Keep .cshrc, but mention .tcshrc and tell them to delete it >2) Keep .cshrc, but mention .tcshrc and tell them to rename it to >.cshrc first then edit it (with hints how to do that editing) >3) Switch to .tcshrc, telling them how to edit it >4) use ~/Library/init/tcsh/environment.mine Thanks a lot...! Cheers... Last edited by sao; 02-01-2002 at 12:47 PM. |
|
|
|
|
|
#2 |
|
League Commissioner
Join Date: Jan 2002
Posts: 5,536
|
yeah, i see a few problems here, and the goal is always to minimize the pain. but, to do so, you have to know about shell startup sequence.
this is one example of where UNIX is really out in the weeds. in a good world, there would be one user rc script from where all user customization spawns. i believe the ~/library/init/tcsh methodology is an attempt to approach that world. and also in that world, no installer would ever consider even thinking about stomping on a user's custom startup script, not even if it's the smartest installer in the world. don't touch our startup scripts. this is what we think about third party startup script mods: Code:
_
| |
_ _ | | _ _
| \ | || || || |
\ \
so, if an installer tells me it wants to mangle my world, i deny it, create a .product file for the horror, put it's inits in there, and reference it from my startup (like fink). but if an installer doesn't tell me, then what? it's called situational awareness. you've gotta be intimately familiar with your custom world and know when to suspect it got stomped and how to find and repair the problem. sometimes you've just gotta roll your own. here's an interesting exercise: % exec tcsh -V also, there are some considerations to make for a login shell vs. a remote job, but that's for another time. hope that helps |
|
|
|
|
|
#3 |
|
Major Leaguer
Join Date: Jan 2002
Location: Adelaide, South Australia
Posts: 470
|
Do we know whether the codewarrior behaviour is really true? It's somewhat ugly if so, and definitely not friendly.
Just in case someone's wondering what's going on here, I think the central point is the slew of possible locations that can be used for providing your shell with startup commands. In particular, tcsh goes through the central locations, executing those files, then gets to the user's specifications: if it finds a ~/.tcshrc it executes that, and then possibly the ~/.login if it's a login shell, but won't execute the ~/.cshrc file automatically if the ~/.tcshrc file is found first. I guess the easiest way to get around this mess is to create a .tcshrc script which pulls in your .cshrc contents (if you have such a thing). Maybe codewarrior does that? That is, the last line of your .tcshrc could read source .cshrc (If you don't have a .cshrc you can either make this a conditional source, or much more easily, issue the command "touch .cshrc" in your home directory, which won't harm anything extant, but will make a new file if there's nothing there.) Anyway, this seems to work OK, though again, explaining it to someone new to unix is not entirely straightforward. Cheers, Paul |
|
|
|
|
|
#4 |
|
Moderator
Join Date: Jan 2002
Location: Singapore
Posts: 4,237
|
Environment...
mervTormel and pmccann, thanks a lot for your advice !
mervTormel, wrote: <<i believe the ~/library/init/tcsh methodology is an attempt to approach that world.>> I completely agree with you. (to clean up the mess) <<sometimes you've just gotta roll your own. here's an interesting exercise: % exec tcsh -V>> tsch -V is very interesting. How would you use it ? pmccann wrote: <<Anyway, this seems to work OK, though again, explaining it to someone new to unix is not entirely straightforward. >> That's exactly the problem. The Fink page is full of useful information, but very little is explained from the point of view of a Unix newbie. If you have the time, could you explain and perhaps make a small tutorial for newbies on how to work with: ~/Library/init/tcsh/environments.mine (as suggested in my post above) or ~/Library/init/tcsh/login.mine Specifically for tcsh|csh users/ as many fink users would have created a path file in ~/Library/init/tsch and created a .cshrc file with "source /sw/bin/init.csh". Cheers... |
|
|
|
|
|
#5 |
|
Major Leaguer
Join Date: Jan 2002
Location: Adelaide, South Australia
Posts: 470
|
Just a quick one for now: rather than edit my post above I think it's worth a short new one. I wrote that using "source .cshrc" was a way around the difficulty mentioned, but it's actually more helpful to use the command
source ~/.cshrc instead. Why? Well, I just noticed that "sudo tcsh" (ie getting a root shell, but with user's environment!) was giving me a ".cshrc : file not found" error on starting up. Nothing too tragic, it just means that the relative location I included in my first post is inappropriate for this situation. Using ~/.cshrc will work fine with the sudo invocation, as ~ is "mapped" to the admin users home directory. Cheers, Paul |
|
|
|
|
|
#6 | |||||||||||||||||||
|
League Commissioner
Join Date: Jan 2002
Posts: 5,536
|
Re: Environment...
turning on verbose before executing ~/.tcshrc is useful for debugging startup scripts or examining the sequence of startup events. edit: as for the .mine custom startup files, perhaps we can start a new topic and generally cover what to do with these. that might be a considerable post with a lot of subjective bickering, tho. Last edited by mervTormel; 02-02-2002 at 12:06 PM. |
|||||||||||||||||||
|
|
|
|
|
#7 |
|
Moderator
Join Date: Jan 2002
Location: Singapore
Posts: 4,237
|
thanks pmccann,
source ~/.cshrc is a good idea (can it be so easy?) Will test. Cheers... |
|
|
|
|
|
#8 |
|
Moderator
Join Date: Jan 2002
Location: Singapore
Posts: 4,237
|
mervTormel,
thanks for the info on "tsch -V" The idea of a new post is a good one, we could call it : "About .mine custom startup files" And it will not turn always into subjective bickering if we keep it focused to the real beginner (somebody, who opens the term for the first time and says "and now what?") And from what I read in this forum, you and pmccann are the ones with most experience in Unix and can guide beginners very well. Cheers... |
|
|
|
|
|
#9 | |||||||||||||||||||
|
League Commissioner
Join Date: Jan 2002
Posts: 5,536
|
urp! i dunno about that, with regards to me, anyway. i'm a duffer. i'm an old VMS sysAdmin, so perhaps i know a little about complex OS's and how to dig for the tasty nuggets of veracity. but i'm crotchety, too. so, non-subjective focus may be fleeting. and if i see something crazy and dangerous, i may say so. but that is often flame bait. so i may not say anything even though i suspect it would be fortuitous to do so *sigh*. here's a great book: UNIX Power Tools it's a collection of snappy 'tools' contributed by about 40 authors. some make subjective comments in the middle of others contributions, and it's fun to read and see -JP smack down -BB for not considering the consequences or an important omission. i would benefit from your suggested topic as it would cause me to explore other avenues that i have otherwise put off until the fatter fish are fried. as a lot of the posts here do. explore, that is. -mt -- drink deeply from the toilet of truth |
|||||||||||||||||||
|
|
|
|
|
#10 |
|
Moderator
Join Date: Jan 2002
Location: Singapore
Posts: 4,237
|
pmccann,
source ~/.cshrc works as smooth as silk ! Cheers... |
|
|
|
|
|
#11 |
|
Moderator
Join Date: Jan 2002
Location: Singapore
Posts: 4,237
|
Hi mervTormel,
Thanks, will get "Unix Power Tools", I bet it makes a good read. Most of the time the "tasty nuggets" you dig are real gold (and free!). Personally, I learned a lot from your posts and enjoyed your wit. I will think a bit more about the new thread, but soon. Cheers... |
|
|
|
![]() |
|
|