Skip to content

How to stop govc to print out command output #3015

Closed Answered by atc0005
yjiabj123 asked this question in Q&A
Discussion options

You must be logged in to vote

I'm using this command line "VALUE=$(govc cluster.usage -json Cluster-$i | jq -r .CPU.Summary.Used)" to assign the cluster cpu value to VALUE.

If the message is being sent to stderr this is one approach:

VALUE=$(govc cluster.usage -json Cluster-$i 2>/dev/null | jq -r .CPU.Summary.Used)

The tool may have an option to disable logging output. I'm not as familiar with govc, but you should be able to use the help flag to view supported logging flags.

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@yjiabj123
Comment options

@atc0005
Comment options

Answer selected by yjiabj123
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants