profile PATH include subdirectories


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers profile PATH include subdirectories
# 1  
Old 03-02-2011
Question profile PATH include subdirectories

I would like to modify my .profile PATH to include all subdirectories of the directory I specify. For example, right now I have

PATH=$HOME/tier1

Tier1 has a tier2 directory in it. Right now I can execute files from tier1, but not tier2. I know I can add another path with $HOME/tier1/tier2, but I want everything under tier1 to be included with something like $HOME/tier1/*. Is this possible?

Thanks!
# 2  
Old 03-02-2011
In a word no. * is a problem for a PATH declaration in .profile
Code:
PATH=${PATH}:$(find $HOME/tier1 -type d | tr -s '\n' ':' )

Plus, you very definitely want to keep the old PATH created for you in /etc/profile/
This User Gave Thanks to jim mcnamara For This Post:
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Programming

Makefile missing include path Although the path exists and defined

i have make file which i try to make them generic but it keeps to compline it missing include directory this is the makefile : CXX=g++ CPPFAGS= -Wall -O0 -g -std=c++14 INCLUDES = -I/home/vagrant/libuv/include -Isrc LIBS_DIRS = -L/home/vagrant/libuv/build LDFLAGS=... (7 Replies)
Discussion started by: umen
7 Replies

2. Shell Programming and Scripting

Adding to the end of the path in .profile

Hi there, I have the following in my path: export PATH=/usr/bin:/usr/sbin But I want to change it programmatically(for the purpose of JBoss automatic(ansible) installs) to: export PATH=/usr/bin:/usr/sbin:/usr/jdk/jdk1.8.0_60 and after that I need to insert the JAVA_HOME programmatically,... (7 Replies)
Discussion started by: hvdalsen
7 Replies

3. Shell Programming and Scripting

How to print only the final path of subdirectories?

Hello, stumped with the find command to show the final path of subdirectories. Used the command find /dir1 -type d Output: /dir1/dirA /dir1/dirA/dirB /dir1/dirA/dirB/dirC Desired output is: /dir1/dirA/dirB/dirC Please help with awk statement or find syntax. Thanks in... (6 Replies)
Discussion started by: ux4me
6 Replies

4. Shell Programming and Scripting

Copy down remote files and rename them to include the server name with full path

I need to pull down a good bit of files for another support team for an upgrade project. I have a server.list with all of the server names. I need to do two parts: FIRST: I have this example, but it does not list the server name in front of each line. #! /bin/bash for server in $(<... (10 Replies)
Discussion started by: asnatlas
10 Replies

5. Shell Programming and Scripting

How to list all Subdirectories and files with its full path in a parent directory?

How to list all Subdirectories and files with its full path in a parent directory? (1 Reply)
Discussion started by: johnveslin
1 Replies

6. Shell Programming and Scripting

make file (include files path)

Hi All, In make file i want to include header files from my local directory and if it did not find in local directory i want to include from network directory. can any help me how i can do this?. here is the code INCLUDE=${include}/ this is point to network dir how i can add option that it... (1 Reply)
Discussion started by: goraya430
1 Replies

7. Linux

libtool compile mode,how to set include path?

Hi all I want to compile a source gt_util.c into a lo file, I use libtool gcc -g -O -c gt_util.c -I./include but it prompts me : cannot determin name of library object from 'include' how should I use the tool to compile a source to .lo file? Thanks. (0 Replies)
Discussion started by: steven_TTG
0 Replies

8. UNIX for Dummies Questions & Answers

Edited Path in Profile File

Definitely a unix dummy. I edited the paths in the /etc/profile file - following the instructions on an install package. Now can't use vi, cat pg ls or any other unix commands. Guess I'm in big trouble. Path reads MANPATH=/opt/hpnp/man PATH=/opt/hpnpl/bin LD_LIBRARY_PATH=/opt/hpnp/lib ... (4 Replies)
Discussion started by: thewetch
4 Replies

9. Solaris

Path /usr/include/iso not found

Hello, I got a make compilation error saying make: *** No rule to make target `/usr/include/iso/stdio_iso.h', needed by `.test.d'. Stop. The mentioned folder `/usr/include/iso/' doesnt exist in solaris5.7 sparc that i am using. I need to know which package will actually install the... (1 Reply)
Discussion started by: Nads
1 Replies

10. UNIX for Dummies Questions & Answers

Modifying $PATH variable in /etc/profile

In my /etc/profile, my $PATH variable is set as follows: $PATH =/sbin:/usr/sbin:/usr/bin:/etc Then how do I add an additional directory to it? say /export/home/abd/rose Please advise. Thanks! Deepali (3 Replies)
Discussion started by: Deepali
3 Replies
Login or Register to Ask a Question