bug-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: variables


From: Eric Blake
Subject: Re: variables
Date: Mon, 30 Jul 2007 06:53:42 -0600
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.5) Gecko/20070716 Thunderbird/2.0.0.5 Mnenhy/0.7.5.666

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

According to lacsap on 7/30/2007 6:11 AM:
> i have 2 scripts : example : toto.sh (main script) and toto.conf.sh
> 
> toto.conf.sh :
> 
...
>   exit 0

If you want toto.conf.sh to be sourced as part of a larger script, you
should either use return or just let the exit status implicitly be that of
the last executed command, rather than calling exit on success (otherwise,
you would be exiting the larger script as well).

> 
> toto.sh :
> 
>   domain=""
>   site_name=$1
>   ./toto.conf.sh $site_name 

As written, you are invoking toto.conf.sh independently, in its own shell
environment.  If you want toto.conf.sh to affect the current environment,
you need to source it - look at the documentation for '.' (also known as
'source').

- --
Don't work too hard, make some time for fun as well!

Eric Blake             ebb9@byu.net
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.5 (Cygwin)
Comment: Public key at home.comcast.net/~ericblake/eblake.gpg
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFGrd9W84KuGfSFAYARAskyAKCEapIDMUHV/XwAAZXdC+8BWAVMdwCfZHi9
kU2wLSrH8Oc2zIPftORLMjY=
=FtHn
-----END PGP SIGNATURE-----




reply via email to

[Prev in Thread] Current Thread [Next in Thread]