zsh-users
 help / color / mirror / code / Atom feed
From: Bruce Stephens <B.Stephens@isode.com>
To: zsh-users@math.gatech.edu
Subject: Re: PATH editing in a script
Date: Tue, 24 Feb 1998 13:31:46 +0000	[thread overview]
Message-ID: <199802241330.IAA12525@math.gatech.edu> (raw)
In-Reply-To: Your message of "Tue, 24 Feb 1998 14:11:47 +0100." <jarausch-980224141145.A016422@numa1>

jarausch@IGPM.Rwth-Aachen.DE 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.



  reply	other threads:[~1998-02-24 13:46 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1998-02-24 13:11 Helmut Jarausch
1998-02-24 13:31 ` Bruce Stephens [this message]
1998-02-24 14:28 ` Bernd Eggink
1998-03-02  1:06   ` Hank Hughes
1998-03-03 10:31     ` Bernd Eggink
1998-02-24 14:55 Niall Smart

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=199802241330.IAA12525@math.gatech.edu \
    --to=b.stephens@isode.com \
    --cc=zsh-users@math.gatech.edu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).