Loading ...
Sorry, an error occurred while loading the content.

Re: [TTLUG] The linux equivalent of a PATH statement

Expand Messages
  • Mikhail
    Ooops, that should be export PATH=$PATH:/your/additional/path:/another/one:/etc also you can symlink your program in a directory already in your path ln -s
    Message 1 of 6 , Sep 2, 2003
    • 0 Attachment
      Ooops, that should be

      export PATH=$PATH:/your/additional/path:/another/one:/etc

      also you can symlink your program in a directory already in your path

      ln -s /path/to/your/program /path/in/path/statement/program

      you can find out your path by

      echo $PATH

      Mikhail.

      Mikhail wrote:
      > Nissan, you can add a line like
      >
      > export PATH=$PATH:\your\additional\path:\another\one:\etc
      >
      > to one of you startup scripts. I usually do the modifications in
      > /etc/rc.d/rc.local which is the last script to run in a slackware
      > startup...I think its in other distros as well.
      >
      > Mikhail.
      >
      > Nissan Dookeran wrote:
      >
      >>What's the equivalent location of the DOS/Win PATH statement?
      >>I wish to be able to run from command line anywhere in Linux a program
      >>which is not stored in any of the standard paths. In DOS I would type a
      >>PATH=%PATH%;c:\whatever\; to add it to my standard path.
      >>How do you do this in Linux?
      >>-Nissan
      >>
      >>
      >>
      >>Help build TTLUG by forwarding this to anyone who is interested in the
      >>subject matter or would otherwise benefit from joining the mailing list.
      >>
      >>Trinidad and Tobago Linux Users Group http://groups.yahoo.com/group/ttlug
      >>To subscribe, send an email to_______ TTLUG-subscribe@yahoogroups.com
      >>To unsubscribe, send an email to_____ TTLUG-unsubscribe@yahoogroups.com
      >>List owner/moderator Richard Jobity__ TTLUG-owner@yahoogroups.com
      >>
      >>
      >>Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
      >>
      >>
      >>
      >>
      >
      >
      >
      >
      >
      > Help build TTLUG by forwarding this to anyone who is interested in the
      > subject matter or would otherwise benefit from joining the mailing list.
      >
      > Trinidad and Tobago Linux Users Group http://groups.yahoo.com/group/ttlug
      > To subscribe, send an email to_______ TTLUG-subscribe@yahoogroups.com
      > To unsubscribe, send an email to_____ TTLUG-unsubscribe@yahoogroups.com
      > List owner/moderator Richard Jobity__ TTLUG-owner@yahoogroups.com
      >
      >
      > Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
      >
      >
      >
      >
    • Richard Hamel-Smith
      ... Normally, you would set your path in your .bashrc file or .profile. These files are usually found in the directory you end up in, just after you login. You
      Message 2 of 6 , Sep 2, 2003
      • 0 Attachment
        Nissan Dookeran wrote:
        > What's the equivalent location of the DOS/Win PATH statement?
        > I wish to be able to run from command line anywhere in Linux a program
        > which is not stored in any of the standard paths. In DOS I would type a
        > PATH=%PATH%;c:\whatever\; to add it to my standard path.
        > How do you do this in Linux?
        > -Nissan
        >
        >

        Normally, you would set your path in your .bashrc file or .profile.
        These files are usually found in the directory you end up in, just after
        you login.

        You can use either

        PATH=$PATH:/path/to/the/program/you/want/to/run

        or

        export PATH=$PATH:/path/to/the/program/you/want/to/run

        Notice that colons are used to separate directories in a PATH variable,
        not semi-colons are in DOS.

        If you login and find that the contents of your .bashrc or .profile are
        not being picked up, try

        source .bashrc

        or

        source .profile

        I believe .bashrc has precedence over .profile, but don't quote me on this.

        If you really need to get to grips with the intricacies of UNIX/Linux
        command line, you *need* to get the O'reilly book "UNIX Power Tools". It
        explains practically every nuance of the shell you will ever need to
        know. It's easy to read, too.

        There are lots of little tricks you can do in the shell. For example,
        you can put a PATH statement inside a shell script. This ensures that no
        matter what the user's external PATH, the shell script will find all the
        commands it needs.

        Lots of fun stuff. I recommend you print out the man page for bash and
        study it. It's full of weird and interesting stuff.

        Finally, if you want to ensure that all users on the system get access
        to the same PATH, you can set the PATH variable in /etc/bashrc or
        /etc/profile. All users normally pull those files into their local
        .bashrc or .profile.

        To see what other environment variables or shell variables you may have
        set, type either

        set

        or

        export

        at the $ prompt.

        Post-finally, just a note, if you can think of it in DOS, it has been
        done in UNIX. Where do you think tree-structured directories came from
        in the first place?

        Regards,

        Richard
      • Raul Bermudez
        Are we to kiss your ring from now on, or will a simple genuflection do? --
        Message 3 of 6 , Sep 2, 2003
        • 0 Attachment
          Are we to kiss your ring from now on, or will a simple genuflection do?

          --

          >
          > From: Richard Hamel-Smith <rhamel@...>
          > Reply-To: TTLUG@yahoogroups.com
          > Date: Tue, 02 Sep 2003 20:49:06 -0400
          > To: TTLUG@yahoogroups.com
          > Subject: Re: [TTLUG] The linux equivalent of a PATH statement
          >
          >
          > ...if you can think of it in DOS, it has been done in UNIX. Where do
          > you think tree-structured directories came from in the first place?
          >
          > Regards,
          >
          > Richard
          >
        • Richard Hamel-Smith
          ... The ring, the ring! Sorry, I rambled. The doctor has me on mind-altering drugs, so I may be thinking clearly. Or not. As the case may be. Or not be. I ll
          Message 4 of 6 , Sep 2, 2003
          • 0 Attachment
            Raul Bermudez wrote:
            > Are we to kiss your ring from now on, or will a simple genuflection do?
            >

            The ring, the ring!

            Sorry, I rambled. The doctor has me on mind-altering drugs, so I may be
            thinking clearly. Or not. As the case may be. Or not be. I'll let you
            know in the morning. Or ...

            Richard

            or

            Drahcir
          Your message has been successfully submitted and would be delivered to recipients shortly.