All of lore.kernel.org
 help / color / mirror / Atom feed
From: Eric Bambach <eric@cisu.net>
To: DogWalker <forestiero@qwest.net>
Cc: linux-newbie@vger.kernel.org
Subject: Re: Adding to the PATH but not if already in $PATH
Date: Sat, 26 Feb 2005 14:34:46 -0600	[thread overview]
Message-ID: <200502261434.46500.eric@cisu.net> (raw)
In-Reply-To: <20050226192604.1405.90540@linux.local>

On Saturday 26 February 2005 01:40 pm, you wrote:
> "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.

errr....check the *logic* on that. The syntax is mostly good but treat it as 
pseudocode. I wrote that after I just woke up ;) But I think you got the 
picture.

> Great!
>
> Sorry about the double post: kmail did what I said not what
> I meant.

-- 
----------------------------------------
--EB

> All is fine except that I can reliably "oops" it simply by trying to read
> from /proc/apm (e.g. cat /proc/apm).
> oops output and ksymoops-2.3.4 output is attached.
> Is there anything else I can contribute?

The latitude and longtitude of the bios writers current position, and
a ballistic missile.

                --Alan Cox LKML-December 08,2000 

----------------------------------------
-
To unsubscribe from this list: send the line "unsubscribe linux-newbie" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.linux-learn.org/faqs

  reply	other threads:[~2005-02-26 20:34 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
2005-02-26 20:34     ` Eric Bambach [this message]
  -- 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=200502261434.46500.eric@cisu.net \
    --to=eric@cisu.net \
    --cc=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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.