changeset 693:c7309e7625ba

add indrect referencing example
author Jeff Hammel <k0scist@gmail.com>
date Wed, 02 Jul 2014 10:50:04 -0700
parents 80c47cc35f37
children ebca6d85213a
files bin/example/indirect.sh
diffstat 1 files changed, 11 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/bin/example/indirect.sh	Wed Jul 02 10:50:04 2014 -0700
@@ -0,0 +1,11 @@
+#!/bin/bash
+
+NAME=foo
+PASSWORD=bar
+IP_ID=91
+ENV=prod
+
+for i in NAME PASSWORD IP_ID ENV
+do
+    echo "export $i=\"$(eval echo \$$i)\""
+done