Re: Input and output for program

Shawn Bayern (shawn.bayern@yale.edu)
Mon, 18 Jan 1999 21:50:40 -0500 (EST)

On Mon, 18 Jan 1999, Shawn Bayern wrote:

> On Mon, 18 Jan 1999, Min-Ken Lai wrote:
>
> > I believe they have already added "." to the path, and I have yet to
> > figure out how to write a script to take exactly that element OUT of my
> > path. (If anyone would like to write one for me, please do!) Needless to
> > say, the "." in the path is a good deal easier to put in than to take out.
>
> This is not guaranteed to work in all cases, but offhand, it's a good
> starting point:
>
> set path = (`echo $path | sed 's/ . //'`)

I realized a while ago that this is horribly wrong. Not only does . come
at the END of the path on the Zoo, making the final space inappropriate,
but in this context, . matches *any* character. :)

A better solution, in this particular case, is

set path = (`echo $path | sed 's/ \.$//'`)

You get the idea...

Shawn