[openstack-dev] [openstackclient] Use and practices of --format shell for defining individual variables
Ronald Bradford
me at ronaldbradford.com
Wed May 27 12:50:21 UTC 2015
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 <doug at 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-request at lists.openstack.org?subject:unsubscribe
> http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstack.org/pipermail/openstack-dev/attachments/20150527/a85a27ec/attachment.html>
More information about the OpenStack-dev
mailing list