Re: adding a folder to my path

2013-01-03 Thread Andrey Repin
Greetings, LMH!

 I think this is a cygwin question, though it is certainly a general 
 linux question as well. I would like to divide up and organize some of 
 the apps and links in my path directories (such as /usr/local/bin) into 
 sub directories. If I add a folder to /usr/local/bin, that folder is not 
 in my path. Can someone give me the instructions for adding a folder 
 such as /usr/local/bin/ruby_viewer/ to my path?

Answers already given aside, you shouldn't do that.


--
WBR,
Andrey Repin (anrdae...@freemail.ru) 04.01.2013, 07:17

Sorry for my terrible english...


--
Problem reports:   http://cygwin.com/problems.html
FAQ:   http://cygwin.com/faq/
Documentation: http://cygwin.com/docs.html
Unsubscribe info:  http://cygwin.com/ml/#unsubscribe-simple



adding a folder to my path

2013-01-02 Thread LMH
I think this is a cygwin question, though it is certainly a general 
linux question as well. I would like to divide up and organize some of 
the apps and links in my path directories (such as /usr/local/bin) into 
sub directories. If I add a folder to /usr/local/bin, that folder is not 
in my path. Can someone give me the instructions for adding a folder 
such as /usr/local/bin/ruby_viewer/ to my path?


LMH

--
Problem reports:   http://cygwin.com/problems.html
FAQ:   http://cygwin.com/faq/
Documentation: http://cygwin.com/docs.html
Unsubscribe info:  http://cygwin.com/ml/#unsubscribe-simple



Re: adding a folder to my path

2013-01-02 Thread Ryan Johnson

On 02/01/2013 10:18 AM, LMH wrote:
I think this is a cygwin question, though it is certainly a general 
linux question as well. I would like to divide up and organize some of 
the apps and links in my path directories (such as /usr/local/bin) 
into sub directories. If I add a folder to /usr/local/bin, that folder 
is not in my path. Can someone give me the instructions for adding a 
folder such as /usr/local/bin/ruby_viewer/ to my path?
This is a very basic linux question, whose precise answer will depend on 
which shell you use (sh, bash, tcsh, etc.), regardless of the underlying 
OS (cygwin, linux, solaris, etc.).


Assuming bash, you might start with 
http://tldp.org/LDP/Bash-Beginners-Guide/html/sect_03_02.html


Ryan


--
Problem reports:   http://cygwin.com/problems.html
FAQ:   http://cygwin.com/faq/
Documentation: http://cygwin.com/docs.html
Unsubscribe info:  http://cygwin.com/ml/#unsubscribe-simple



Re: adding a folder to my path

2013-01-02 Thread Aaron Schneider

On 02/01/2013 18:18, LMH wrote:

I think this is a cygwin question, though it is certainly a general
linux question as well. I would like to divide up and organize some of
the apps and links in my path directories (such as /usr/local/bin) into
sub directories. If I add a folder to /usr/local/bin, that folder is not
in my path. Can someone give me the instructions for adding a folder
such as /usr/local/bin/ruby_viewer/ to my path?


As stated here: http://cygwin.com/ml/cygwin/2013-01/msg00023.html
you can do it two ways

1) Add /usr/local/bin/ruby_viewer/ to your profile:
$ echo 'PATH=`echo $PATH`:/usr/local/bin/ruby_viewer/'  
$HOME/.bash_profile


2) Add it directly to Windows' path:
Start  Control Panel  System  Advanced system settings  Advanced  
Environment variables  PATH  Edit  Add to the end


;C:\cygwin\usr\local\bin\ruby_viewer

--
Problem reports:   http://cygwin.com/problems.html
FAQ:   http://cygwin.com/faq/
Documentation: http://cygwin.com/docs.html
Unsubscribe info:  http://cygwin.com/ml/#unsubscribe-simple



Re: adding a folder to my path

2013-01-02 Thread Andrew DeFaria

On 1/2/2013 9:18 AM, LMH wrote:
I think this is a cygwin question, though it is certainly a general 
linux question as well. I would like to divide up and organize some of 
the apps and links in my path directories (such as /usr/local/bin) 
into sub directories. If I add a folder to /usr/local/bin, that folder 
is not in my path. Can someone give me the instructions for adding a 
folder such as /usr/local/bin/ruby_viewer/ to my path?

This is a basic question that is shell specific and all.

What I do is I have a function, called append_to_path:

   append_to_path ()
   {
component=$1;
if [ -d $component ]; then
if [ -z $PATH ]; then
PATH=$component;
else
PATH=$PATH:$component;
fi;
fi
   }

It appends to the PATH IFF the component passed in is a directory that 
exists. This allows me to loop through a set of directories knowing that 
only those that exist will end up on the path:


   systemroot=$(cygpath -u $SYSTEMROOT)
   path_dirs=\
  .\
  $HOME/bin\
  /opt/Rational/Clearcase/bin\
  ...
  /usr/local/bin\
  ...
  $systemroot/System32\
  $systemroot

   PATH=
   for component in $path_dirs; do
  append_to_path $component
   done

This allows me to set my PATH from scratch exactly how I want it. I add 
Unix paths, Solaris paths, HP_UX paths, FreeBSD paths and Windows paths 
to path_dirs. The net result is that I get the right set of paths on 
each of these systems dynamically.


YMMV.
--
Andrew DeFaria http://defaria.com
This space for rent


--
Problem reports:   http://cygwin.com/problems.html
FAQ:   http://cygwin.com/faq/
Documentation: http://cygwin.com/docs.html
Unsubscribe info:  http://cygwin.com/ml/#unsubscribe-simple