title: Zsh / Shell - how to assign something to a variable quietly?
body: <p>I'm having trouble assigning a value quietly ( no console output ) to a variable.</p>
  
  <p>I want to assign <code>npm list -g</code>to a variable but without any console output, so I did this:</p>
  
  <pre><code>npm_list=$(npm list -g &amp;&gt; /dev/null)
  </code></pre>
  
  <p>but when I do that <code>$npm_list</code> outputs nothing ( I think because I return npm's output to /dev/null ).</p>
  
  <p>yeah..., so how do I do it? I'm pretty new to shell programming.</p>
  
  <p>Thanks in advance!</p>