Usenet comp.unix.tru64 (2000-2013)
 help / color / mirror / Atom feed
From: Bob Harris <nospam.News.Bob@remove.Smith-Harris.us>
Subject: Re: some queris on .profile file
Date: Sun, 18 Jun 2006 01:21:49 GMT	[thread overview]
Message-ID: <nospam.News.Bob-1C5FE6.21222317062006@news.verizon.net> (raw)
In-Reply-To: 1150576687.026459.179060@u72g2000cwu.googlegroups.com

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 2147 bytes --]

In article 
<1150576687.026459.179060@u72g2000cwu.googlegroups.com>,
 "mehaboob@gmail.com" <mehaboob@gmail.com> wrote:

> Piotr Hosowicz wrote:
> 
> > mehaboob@gmail.com wrote:
> >
> > > I did understand about your explanation for ./.profile
> > > But what is the initail dot and space for?
> > > i.e    . ./.profile
> >
> > Hi Mehaboob,
> >
> > In some shells there is a command named source, if you do :
> >
> > source some-script.sh
> >
> > ... then some-script.sh is sourced into current running shell, meaning
> > "including" the script some-script.sh. There are some gotchas, like for
> > example if you have :
> >
> > exit
> >
> > .. in some-script.sh then it will exit the whole calling shell and not
> > terminate "sourceing" some-script.sh.
> >
> > Single dot is equivalent to source'ing some script, so above is
> > equivalent to :
> >
> > . some-script.sh
> >
> >
> > --
> > No signature found.
> 
> Thanks for taking time to explain.
> I have some more confusion
> 
> 
> if we apply the  rules source some-script.sh then we get
> source <filename>  i.e
> source .profile
> 
> If I have execute .profile then the command would be
> ./<filename>  i.e
> ./.profile
> 
> But my confusion why do we have source and execute
> source execute the file  i.e
> souce ./<filename>    i.e
> . ./.profile
> 
> 
> Regards,
> Mehaboob

Sourcing a script (eg:  . ./.profile) will allow tht script to set 
local variables, environment variables, shell options, aliases, 
create functions, etc... for your running shell.  In this case it 
would be your interactive shell.  So it can alter your current 
shell environment.

Invoking an executable shell (eg:  ./.profile) will run that shell 
script in a subprocess.  All variables, environment variables, 
shell options, aliases, and functions created or modified will be 
lost as soon as that script finishes.

Think of it as going to dinner with a friend, and your buying.  
You both consuem food, but when your friend leaves, the calories 
he/she consumed, leaves with them.  But the calories you ate get 
to go home with your.  Bon App�tit :-)

                                        Bob Harris


  parent reply	other threads:[~2006-06-18  1:21 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-06-15 10:15 some queris on .profile file mehaboob
2006-06-15 12:37 ` Wim Cossement
2006-06-15 19:55 ` Adam Price
2006-06-16  9:15   ` mehaboob
2006-06-16 15:27     ` Wim Cossement
2006-06-17 18:21       ` mehaboob
2006-06-17 18:56         ` Piotr Hosowicz
2006-06-17 20:38           ` mehaboob
2006-06-17 22:07             ` Piotr Hosowicz
2006-06-18  1:21             ` Bob Harris [this message]
2006-06-18 15:33               ` mehaboob
2006-06-18 17:57                 ` Bob Harris
2006-06-18 21:24                   ` mehaboob
2006-06-19  0:57                     ` Bob Harris
read-only archive

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox