[NBLUG/talk] fighting Ubuntu, and the "source" bash command

Barry Stump barry.stump at gmail.com
Mon Jul 7 09:47:21 PDT 2008


One thing that might help to know is that newer versions of Ubuntu use
dash for many scripts (anything referencing /bin/sh in fact) while
retaining bash for your login.  I don't remember when this change
first occurred, but I think it was later than 6.06.

-Barry

On Mon, Jul 7, 2008 at 9:29 AM, Lincoln Peters <anfrind at gmail.com> wrote:
> On Mon, Jul 7, 2008 at 8:28 AM, Bob Blick <bobblick at ftml.net> wrote:
>> That's funny because in the past if I had a script I wanted to execute
>> I'd either make sure it had a shebang (#!/bin/bash) line in it or else
>> just preface the script name with /bin/bash on the command line. That's
>> just how I'd always done it. So does "source" do exactly the same thing,
>> or is it the new improved way to do this?
>
> The difference is that the "source" commands executes the script in
> your current environment, whereas other methods of execution execute
> the script in a COPY of your current environment.  That makes the
> "source" command useful if, for example, you sometimes want to set a
> bunch of environment variables with a single command but you don't
> always want them set, or you have multiple configurations you want to
> be able to choose from.
>
>
> --
> Lincoln Peters
> <anfrind at gmail.com>
>
> _______________________________________________
> talk mailing list
> talk at nblug.org
> http://nblug.org/cgi-bin/mailman/listinfo/talk
>



More information about the talk mailing list