starting a file from another directory with a script

James Mcphee jmcphe at gmail.com
Sun Dec 4 23:01:55 MST 2011


If you do the dot and then space, and then the file name (with path unless
it's in $PATH), then it will execute in the current shell.  That means you
can set your prompt or whatnot and it will affect your current shell.

. /path/to/script

I use this to do things like set my prompt and whatnot.  It's basically
shorthand for calling "source".

The technical details are that it does not fork a new process and run the
program in the new shell, but will run it in the current process space.
 Instead of a fork and exec, it just issues an exec.

The "." in ./script is shorthand for your current directory.  That's why
when you do an "ls -al" you see "." and "..".  The ".." is parent
directory, so it's a way of saying "back up a directory".  If you're in
/home/name/blah/yadda, and you want to execute /home/name/lala, then issue
"../../lala/script"

Anyway, just giving you more info to confuse you :)

On Sun, Dec 4, 2011 at 10:39 PM, Michael Havens <bmike1 at gmail.com> wrote:

> I put the right terms into google finally and found out to put a full path
> name without the leading dot. I always thought that the dot meant that you
> were telling the computer you were running a program (you know- ./). Silly
> me.
> --
> :-)~MIKE~(-:
>
> ---------------------------------------------------
> PLUG-discuss mailing list - PLUG-discuss at lists.plug.phoenix.az.us
> To subscribe, unsubscribe, or to change your mail settings:
> http://lists.PLUG.phoenix.az.us/mailman/listinfo/plug-discuss
>



-- 
James McPhee
jmcphe at gmail.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.PLUG.phoenix.az.us/pipermail/plug-discuss/attachments/20111204/7f61ea7b/attachment.html>


More information about the PLUG-discuss mailing list