From: "DogWalker" <forestiero@qwest.net>
To: linux-newbie@vger.kernel.org
Subject: Re: Adding to the PATH but not if already in $PATH
Date: Sat, 26 Feb 2005 11:40:15 -0800 [thread overview]
Message-ID: <20050226192604.1405.90540@linux.local> (raw)
In-Reply-To: <200502261305.35751.eric@cisu.net>
[-- Attachment #1: Type: text/plain, Size: 574 bytes --]
"Eric Bambach" <eric@cisu.net> said:
>On Saturday 26 February 2005 12:17 pm, you wrote:
>> I want to prepend a directory to my PATH in my $HOME/.bashrc and export the
>> result. But I only want it to happen once: iow, if a directory I want
>> prepended is already in the PATH, do not prepend it again.
>>
>
[...]
>sed and grep can help.
>
>echo $PATH | grep 'SOMEPATH'
>if [ $? == 0 ];then
> export PATH
>else
> PATH=NEWPATH
>fi
>
>Check the login on that though, shouldnt be too hard.
Great!
Sorry about the double post: kmail did what I said not what
I meant.
next prev parent reply other threads:[~2005-02-26 19:40 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-02-26 18:17 Adding to the PATH but not if already in $PATH Dog Walker
2005-02-26 19:05 ` Eric Bambach
2005-02-26 19:40 ` DogWalker [this message]
2005-02-26 20:34 ` Eric Bambach
-- strict thread matches above, loose matches on Subject: below --
2005-02-26 18:16 Dog Walker
2005-02-26 22:44 ` chuck gelm
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=20050226192604.1405.90540@linux.local \
--to=forestiero@qwest.net \
--cc=linux-newbie@vger.kernel.org \
/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.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox