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
Catalyst::View::Mason(3pm)				User Contributed Perl Documentation				Catalyst::View::Mason(3pm)

NAME
Catalyst::View::Mason - Mason View Class SYNOPSIS
# use the helper script/create.pl view Mason Mason # lib/MyApp/View/Mason.pm package MyApp::View::Mason; use base 'Catalyst::View::Mason'; __PACKAGE__->config(use_match => 0); 1; $c->forward('MyApp::View::Mason'); DESCRIPTION
Want to use a Mason component in your views? No problem! Catalyst::View::Mason comes to the rescue. EXAMPLE
From the Catalyst controller: $c->stash->{name} = 'Homer'; # Pass a scalar $c->stash->{extra_info} = { last_name => 'Simpson', children => [qw(Bart Lisa Maggie)] }; # A ref works too From the Mason template: <%args> $name $extra_info </%args> <p>Your name is <strong><% $name %> <% $extra_info->{last_name} %></strong> <p>Your children are: <ul> % foreach my $child (@{$extra_info->{children}}) { <li><% $child %></li> % } </ul> METHODS
new($app, \%config) get_component_path Returns the component path from $c->stash->{template} or $c->request->match or $c->action (depending on the use_match setting). process Renders the component specified in $c->stash->{template} or $c->request->match or $c->action (depending on the use_match setting) to $c->response->body. Note that the component name must be absolute, or is converted to absolute (i.e., a / is added to the beginning if it doesn't start with one). Mason global variables $base, $c, and $name are automatically set to the base, context, and name of the app, respectively. render($c, $component_path, \%args) Renders the given template and returns output, or a HTML::Mason::Exception object upon error. The template variables are set to %$args if $args is a hashref, or $c->stash otherwise. config This allows you to to pass additional settings to the HTML::Mason::Interp constructor or to set the options as below: "template_extension" This string is appended (if present) to "$c->action" when generating a template path. Defaults to an empty string. Example: "template_extension => '.html'" "always_append_template_extension" Set this to a true value if you want "template_extension" to be appended to the component path even if it was explicitly set. Defaults to 0. Example: "always_append_template_extension => 1" "use_match" Use "$c->request->match" instead of "$c->action" to determine which template to use if "$c->stash->{template}" isn't set. This option is deprecated and exists for backward compatibility only. Currently defaults to 0. Old code should set this to 1 to avoid breakage. Example: "use_match => 0" The default HTML::Mason::Interp config options are as follows: "comp_root" "$app->config->root" "data_dir" "File::Spec->catdir( File::Spec->tmpdir, sprintf('%s_%d_mason_data_dir', $app, $<) )" "allow_globals" "qw/$c $name $base/" If you add additional allowed globals those will be appended to the list of default globals. SEE ALSO
Catalyst, HTML::Mason, "Using Mason from a Standalone Script" in HTML::Mason::Admin AUTHORS
Andres Kievsky "ank@cpan.org" Sebastian Riedel "sri@cpan.org" Marcus Ramberg Florian Ragwitz "rafl@debian.org" Justin Hunter "justin.d.hunter@gmail.com" COPYRIGHT
This program is free software, you can redistribute it and/or modify it under the same terms as Perl itself. perl v5.14.2 2009-08-22 Catalyst::View::Mason(3pm)
All times are GMT -4. The time now is 10:55 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy