Re: lacking authority

[prev] [thread] [next] [lurker] [Date index for 2007/01/11]

From: Yossi Kreinin
Subject: Re: lacking authority
Date: 13:22 on 11 Jan 2007
Nicholas Clark wrote:
> 
> I hate the way tcsh uses ^D for filename completion.
> Unless, of course, your line is empty in which case ^D means EOF.

Around here, we use .*rc files we copy from each other (the files apparently 
came from another planet since following the traces did not lead to a human 
author). These files make tcsh complete things using Tab, which is a bit safer.

Why did I say "complete things" and not "filenames"? Because these 
extraterrestrial .*rc files are too clever to complete filenames, mind you. They 
complete whatever you (should) want, depending on the context. For example, for 
ping they complete hostnames. For make, they complete nothing since make targets 
are not files, and the aliens were smart enough to avoid parsing Makefiles. 
What's that, you say? Actually most of make targets are files? Interesting. Oh, 
and for gcc it won't complete anything so you don't screw yourself with `gcc -o 
src.c`, and for rm it will complete *.c filenames, but not *.h. After all, it's 
the interfaces that are important, not the implementation. You surely don't want 
that accidentally deleted.

Of course there are wizards who don't count on the anonymous humanoids and hack 
up vast software layers on top of tcsh (like having it complete `vi -t` from a 
tags file using a perl one-liner) themselves. An encounter with a shell of a 
mere mortal is a cultural shock for these people - without the aliases they 
behave like a fish taken out of the water. There are only two choices: jump back 
into the water (su - wizard) and drown the offender to get some water around (cp 
~wizard/.*rc ~victim).

> 
> And I remember trying to work up various substitutions in t?csh involving
> $ { and }, and getting them to interpolate at the right time. In a sane
> shell it's easy enough - just get the right level of backslashes, by
> backslashing your backslashes for each level of interpolation you wish to
> pass through before substitution.

I beleive the purpose of the life of those souls doomed to programming in the 
current incarnation is to Find the Right Level of Backslashes.

> 
> In the end I switched my .tschrc to set things up as appropriate then exec
> bash. And for the things that needed sourcing, wrote a tsch wrapper that
> dumped out the environment variables that it had created or changed, munged
> via a real programming language [see previous paragraph] to a format that
> bash could eval.
> 
> And then I was happy*.

I try to run most scripts trashing the environment in subshells, so that these 
scripts don't mess with each other's precious env vars (for instance, if a 
scripts sets $MODE and you have a Makefile getting a MODE argument, etc). And to 
set tcsh env vars I use scripts which emit tcsh commands for setting the env 
vars and eval them.

I don't switch to a different shell since I like people to feel comfortable when 
they work with me on my machine. If I cared more about the shell features, this 
would probably not make sence.
There's stuff above here

Generated at 00:01 on 12 Jan 2007 by mariachi 0.52