Re: starting a file from another directory with a script

Top Page
Attachments:
Message as email
+ (text/plain)
+ (text/html)
+ (text/plain)
Delete this message
Reply to this message
Author: James Mcphee
Date:  
To: Main PLUG discussion list
Subject: Re: starting a file from another directory with a script
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 <> 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 -
> To subscribe, unsubscribe, or to change your mail settings:
> http://lists.PLUG.phoenix.az.us/mailman/listinfo/plug-discuss
>




--
James McPhee

---------------------------------------------------
PLUG-discuss mailing list -
To subscribe, unsubscribe, or to change your mail settings:
http://lists.PLUG.phoenix.az.us/mailman/listinfo/plug-discuss