From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Thread: fa528,1fcb2333482dcee6 X-Google-Attributes: gidfa528,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news2.google.com!news4.google.com!news2.volia.net!news.germany.com!news.nask.pl!news.nask.org.pl!newsfeed.tpinternet.pl!nemesis.news.tpi.pl!atlantis.news.tpi.pl!news.tpi.pl!not-for-mail From: Piotr Hosowicz Newsgroups: comp.unix.tru64 Subject: Re: some queris on .profile file Date: Sun, 18 Jun 2006 00:07:02 +0200 Organization: tp.internet - http://www.tpi.pl/ Message-ID: References: <1150366558.414200.141250@p79g2000cwp.googlegroups.com> <1150449352.642566.101720@c74g2000cwc.googlegroups.com> <1150568477.954146.133060@f6g2000cwb.googlegroups.com> <1150576687.026459.179060@u72g2000cwu.googlegroups.com> NNTP-Posting-Host: aapg171.neoplus.adsl.tpnet.pl Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-2; format=flowed Content-Transfer-Encoding: 7bit X-Trace: nemesis.news.tpi.pl 1150582124 4635 83.5.140.171 (17 Jun 2006 22:08:44 GMT) X-Complaints-To: usenet@tpi.pl NNTP-Posting-Date: Sat, 17 Jun 2006 22:08:44 +0000 (UTC) User-Agent: Mozilla Thunderbird 1.0.7-1.1.fc4 (X11/20050929) X-Accept-Language: en-us, en In-Reply-To: <1150576687.026459.179060@u72g2000cwu.googlegroups.com> Xref: g2news2.google.com comp.unix.tru64:431 mehaboob@gmail.com wrote: > if we apply the rules source some-script.sh then we get > source i.e > source .profile > > If I have execute .profile then the command would be > ./ i.e > ./.profile > > But my confusion why do we have source and execute > source execute the file i.e > souce ./ i.e > . ./.profile Once again - source-inclusion or dot-inclusion are the same and happen in the same shell, that you are running and issuing the source-include or dot-include command. When some-script.sh is executable and you do : ./some-script.sh ... then execution happens in a separate shell, unlike in source-inclusion or dot-inclusion. That's why I mentioned exit command. Frequently people keep asking why their source/dot included scripts end prematurely. Usually this happens when there's an exit in included (sourced) file. -- No signature found.