<div dir="ltr"><br><br><div class="gmail_quote">On Thu, Oct 1, 2009 at 12:57 PM, Tzafrir Cohen <span dir="ltr"><<a href="mailto:tzafrir@cohens.org.il">tzafrir@cohens.org.il</a>></span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<br>
3. You still need to export the variables to make them available in the<br>
environment of the shell script:<br>
<br>
export $EXPORTED_VARS<br>
<br></blockquote></div><br>Well, not necessarily.<br>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)<br>
<br>so:<br><font size="1"><span style="font-family: courier new,monospace;">#!/bin/bash</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">set -a</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">. config.env</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">exec ./script.pl "$@"</span></font><br></div>