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

Bob Blick bobblick at ftml.net
Mon Jul 7 10:04:24 PDT 2008


Thanks everybody, I think I get it. Shells and scripts and backticks are
always a headscratcher for some reason.

Cheerful regards,

Bob



On Mon, 7 Jul 2008 09:47:21 -0700, "Barry Stump" <barry.stump at gmail.com>
said:
> 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.

-- 
http://www.fastmail.fm - Or how I learned to stop worrying and
                          love email again




More information about the talk mailing list