-
Hi team, 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. But when there is no valid cluster, it will automatically dump a message "govc: cluster 'Cluster-2' not found" to the shell even if I don't echo the VALUE. How can I stop it from dumping this message to the shell? Thanks! |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
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 |
Beta Was this translation helpful? Give feedback.
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.