title: How to write in /etc/profile using bash | Permission Denied
body: <p>I'm creating a bash script to set up an Ubuntu 16.04 lts OS to download, install and other stuff without introduce each command separately and I have to write in the /etc/profile file to add a PATH environment variable. When my code get into that line it appears the Permission Denied message, this is what I have:</p>
  
  <pre><code>sudo echo "export PATH=$PATH:/usr/local/go/bin" &gt;&gt; /etc/profile
  bash: /etc/profile: Permission denied
  </code></pre>
  
  <p>Do you know how could I solve this?</p>