Re: Invalid Operating System

[prev] [thread] [next] [lurker] [Date index for 2006/12/11]

From: Peter da Silva
Subject: Re: Invalid Operating System
Date: 15:11 on 11 Dec 2006
On Dec 11, 2006, at 2:08 AM, Yossi Kreinin wrote:
> And what is the obvious way? I really want to know. Around here, 
> everybody uses tcsh, so there's no need to maintain separate scripts, 
> but I surely want a way to setup shell env vars without writing shell 
> scripts.

There's two approaches. You can do this:

     % cat setup-script
     #!/bin/sh -f

     ...

     exec $SHELL
     %

Or this:

     % cat setup-source.tcsh
     set noglob
     eval `setup-script`
     unset noglob
     %

If you do this a lot, writing a small "dump-env" program to stick on 
the tail of setup-script to make it automagically painless is an 
obvious step. It's not even that hard to end the setup-script with 
something like:

     if [ $# -gt 0 ]
     then exec "$@"
     else dump-env CC CFLAGS FOOFLAGS ZOT BOTTLECAP SQUEAMISH OSSIFRAGE
     fi

so it can be used in either context as the user prefers.

>> You're not writing scripts in English.

> Nor do I write scripts in tcsh. Shakespeare did some nice scripting in 
> English though.

Shakespeare did no such thing. The closest thing I know to scripts in 
English are things like Roberts Rules Of Order, statutory law, and 
bureaucratic regulations. These examples should make the problem 
obvious. Languages used in different contexts have different 
requirements.

There's stuff above here

Generated at 22:02 on 27 Dec 2006 by mariachi 0.52