Thanks Doug, I knew there would be a more definitive and simple use. eval is that way!
Ronald Ronald Bradford Web Site: http://ronaldbradford.com LinkedIn: http://www.linkedin.com/in/ronaldbradford Twitter: @RonaldBradford <http://twitter.com/ronaldbradford> Skype: RonaldBradford GTalk: Ronald.Bradford IRC: rbradfor On Tue, May 26, 2015 at 1:19 PM, Doug Hellmann <d...@doughellmann.com> wrote: > Excerpts from Ronald Bradford's message of 2015-05-26 11:18:09 -0400: > > Hi list, > > > > I came across the following neutron client specific syntax and decided to > > see if I could reproduce using the openstack client and it's flexible > > formatting capabilities > > > > > > $ NIC_ID1=$(neutron net-show public | awk '/ id /{print $4}') > > > > $ echo $NIC_ID1 > > 210d976e-16a3-42dc-ac31-f01810dbd297 > > > > I can get similar syntax (unfortunately lowercase variable name only) > with: > > NOTE: It may be nice to be able to pass an option to UPPERCASE all shell > > variables names. > > > > $ openstack network show public -c id --format shell --prefix nic_ > > nic_id="210d976e-16a3-42dc-ac31-f01810dbd297" > > > > However to use this I effectively have to place in a file and source that > > file to expose this variable to my current running shell. > > Reproducing the same syntax does not work obviously. > > It's actually meant to be used with an eval statement: > > $ eval $(openstack network show public -c id --format shell --prefix nic_) > $ echo $nic_id > > Doug > > __________________________________________________________________________ > OpenStack Development Mailing List (not for usage questions) > Unsubscribe: openstack-dev-requ...@lists.openstack.org?subject:unsubscribe > http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev >
__________________________________________________________________________ OpenStack Development Mailing List (not for usage questions) Unsubscribe: openstack-dev-requ...@lists.openstack.org?subject:unsubscribe http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev