On Fri, Oct 02, 2009 at 08:59:37AM +0200, Noam Meltzer wrote:
> On Thu, Oct 1, 2009 at 12:57 PM, Tzafrir Cohen <[email protected]>wrote:
> 
> >
> > 3. You still need to export the variables to make them available in the
> > environment of the shell script:
> >
> >  export $EXPORTED_VARS
> >
> >
> Well, not necessarily.
> At least in bash (I didn''t check /bin/sh) , you can use 'set -a' to
> automatically mark variables and functions which are modified or created for
> export to the environment of subsequent commands. (so knowing the variables
> ahead is not a must)

I didn't check standards, but it is supported by dash, posh and busybox
ash as well here.

> 
> so:
> #!/bin/bash
> set -a
> . config.env
> exec ./script.pl "$@"


-- 
Tzafrir Cohen         | [email protected] | VIM is
http://tzafrir.org.il |                    | a Mutt's
[email protected] |                    |  best
ICQ# 16849754         |                    | friend

_______________________________________________
Linux-il mailing list
[email protected]
http://mailman.cs.huji.ac.il/mailman/listinfo/linux-il

Reply via email to