Sponsored Content
Homework and Emergencies Homework & Coursework Questions Problem with path and child shells Post 302537689 by majickmann on Saturday 9th of July 2011 10:39:50 AM
Old 07-09-2011
The following should be acceptable answers:

a. This will add mytools for the current shell. At command prompt, type the following and hit "enter": PATH=$HOME/mytools:$PATH

b. This will add mytools for child shells as well. At command prompt, type the following and hit "enter": export PATH=$HOME/mytools:$PATH

c. To make this permanent, so commands in mytools directory are usable upon login to the UNIX shell (bash), just add "export PATH=$HOME/mytools:$PATH" to your .bashrc file. Most .bashrc files already have this statement, so it would just be a matter of modifying it.


The placement within PATH is significant. The shell searches for commands from left to right as you read the directories in PATH. In my example, I've placed mytools before all other directories so it is searched first. I do this for two reasons:
1. I want commands in mytools to be used before a command with the same name that is in another directory. Generally, this is not a problem as I don't intentionally use an existing command name.
2. Even if I don't have duplicate command names, I want my scripts to be found quickly. By listing mytools at the beginning, it is searched first. This may only be saving microseconds or less, but that's the way I want it.

Otherwise, adding mytools at the end of the PATH statement is certainly acceptable.

Hope this helps...
--majickmann
 

10 More Discussions You Might Find Interesting

1. IP Networking

child process problem

please do answer it is urgent can any body tell me how can i find whether the child process has been killed or not in a program (1 Reply)
Discussion started by: ramneek
1 Replies

2. UNIX for Dummies Questions & Answers

cc path problem - no acceptable path found

Hello everyone, I'm a unix noob. I have a powerbook running mac os x 10.4 and for one of my classes I need to install the latest version of php (5.0.5). I'm following the instructions at http://developer.apple.com/internet/opensource/php.html to install but I've run into a problem. The... (2 Replies)
Discussion started by: kendokendokendo
2 Replies

3. Shell Programming and Scripting

path problem

hi , i have written csh script i am unable to set PATH variable in my script. my script is like this ===================================== # ! /bin/csh -f setenv PATH "$PATH:/opt/terascan/bin" ls -l > list lspass > pas peekauto > schedule \ num_days = 1 \ exit 0... (1 Reply)
Discussion started by: rajan_ka1
1 Replies

4. UNIX for Advanced & Expert Users

path problem

Hi i am writing a script containing processing commands which are reside in /opt/terascan/bin dir. if i run the script from command prompt it is working fine. but in crontab it is not working. if i give env command from command prompt it is showing /opt/terascan/bin dir in PATH variable. ... (10 Replies)
Discussion started by: rajan_ka1
10 Replies

5. UNIX for Advanced & Expert Users

how to make a parent wait on a child shells running in background?

Hi I have a shell script A which calls another 10 shell scripts which run in background. How do i make the parent script wait for the child scripts complete, or in other words, i must be able to do a grep of parent script to find out if the child scripts are still running. My Code: ... (1 Reply)
Discussion started by: albertashish
1 Replies

6. UNIX for Dummies Questions & Answers

PATH Setting for all shells of a user

How can I modify the path variable of a particular user in all shells? I searched in this forum and as per the advice in some threads created a new file .profile in $HOME directory with the new PATH, but it did not work. (5 Replies)
Discussion started by: JoyceBabu
5 Replies

7. Homework & Coursework Questions

Need help with deleting childīs parent and child subprocess

1. The problem statement, all variables and given/known data: I need to make an program that in a loop creates one parent and five children with fork(). The problem i'm trying to solve is how to delete the parent and child of the childīs process. 2. Relevant commands, code, scripts,... (0 Replies)
Discussion started by: WhiteFace
0 Replies

8. Shell Programming and Scripting

Moving files from parent path to multiple child path using bash in efficient way

Hi All, Can you please provide some pointers to move files from Base path to multiple paths in efficient way.Folder Structure is already created. /Path/AdminUser/User1/1111/Reports/aaa.txt to /Path/User1/1111/Reports/aaa.txt /Path/AdminUser/User1/2222/Reports/bbb.txt to... (6 Replies)
Discussion started by: karthikgv417
6 Replies

9. Shell Programming and Scripting

Problem with PATH

Recently I lost a number of changes I made to a program when the SCO Unix system went down. The system "mail" suggested a "vi -r" option that took me back several days. To prevent this in the future, I am trying to create my own vi command: if then cp -p $1 $1.bak fi /usr/bin/vi $* if ... (5 Replies)
Discussion started by: wbport
5 Replies

10. UNIX for Beginners Questions & Answers

PATH problem

For the sake of not going insane and not buggering a load of needed system stuff, I have created a dir /mybin. (This is a Debian system.) I have then edited the /etc/profile and /etc/login.defs files and added :/mybin to all of the path variables. I have the file /mybin/mtp for... (2 Replies)
Discussion started by: MuntyScrunt
2 Replies
list child(1m)															    list child(1m)

NAME
list child - Displays a list of all the child pointers whose names match the specified child name SYNOPSIS
cdscp list child child-name [with attribute-name = attribute-value] ARGUMENTS
The full name of a specific child pointer. The last simple name can contain wildcard characters. The name of a particular attribute. The value of a particular attribute. DESCRIPTION
The list child command displays a list of all the child pointers whose names match the specified child name. The last simple name can con- tain wildcard characters. You can use a with attribute-name = attribute-value clause to limit output only to child pointers whose attributes have values equal to the specified values. A space must precede and follow the = (equals sign). Privilege Required You must have read permission to the directory that stores the child pointer. If you use a with attribute-name = attribute-value clause in the command, you also need read or test permission to the selected child pointers. NOTE
This command is replaced at Revision 1.1 by the dcecp command and may not be provided in future releases of DCE. EXAMPLE
The following command displays a list of all the child pointers named in the /.:/sales directory: cdscp> list child /.:/sales/* LIST CHILD /.../abc.com/sales AT 1991-10-15-15:56:00 Q1 Q2 Q3 Q4 RELATED INFORMATION
Commands: create child(1m), delete child(1m), show child(1m) list child(1m)
All times are GMT -4. The time now is 02:51 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy