Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: PATH editing in a script
- X-seq: zsh-users 1337
- From: Bruce Stephens <B.Stephens@xxxxxxxxx>
- To: zsh-users@xxxxxxxxxxxxxxx
- Subject: Re: PATH editing in a script
- Date: Tue, 24 Feb 1998 13:31:46 +0000
- In-reply-to: Your message of "Tue, 24 Feb 1998 14:11:47 +0100." <jarausch-980224141145.A016422@numa1>
jarausch@xxxxxxxxxxxxxxxxxxx said:
> Having two versions of (say) TeX I would like to replace the PATH to
> tex in a user PATH environment string.
> Like s|/usr/local/lib/TeX|/usr/local/teTeX|
> It's no problem to edit the PATH e.g. by Perl but these changes have
> to persist whence the (Perl/Zsh) script finishes.
You can't. Environment variables are local to processes (and may get
inherited by child processes, but that doesn't help here).
You can do something like (warning: untested code ahead):
PATH=$(echo $PATH | sed 's|/usr/local/lib/TeX|/usr/local/teTeX|')
You could stick this in a shell function (possibly autoloaded) or an alias.
Messages sorted by:
Reverse Date,
Date,
Thread,
Author