On Thu, 31 Jul 2014, Chet Ramey wrote:
On 7/31/14, 10:51 AM, Linda Walsh wrote:
...
I thought the idea of RO vars being passed to children was considered
desirable?

As Greg says, there's no existing mechanism to do that using the
environment, which is the only way to communicate across exec(2).  I
could invent something, but what would be the point?

  It's not hard to do, e.g. as a comma-separated list of readonly
  variables:

export READONLY_VARS=foo,bar,why,not foo bar why not

  In the receiving script:

if [[ -n $READONLY_VARS ]]
then
  IFS=, read -a rov <<< "$READONLY_VARS"
  readonly "${rov[@]}"
fi
foo=q ## not permitted

--
Chris F.A. Johnson, <http://cfajohnson.com>

Reply via email to