title: Redirect output to /dev/null when two commands are piped?
body: <p>I am trying to build a docker image for android CI systems but wanted to avoid a heavy log file. So to avoid output on stdout I wanted it to redirect to <code>/dev/null</code>. I am a novice in using linux commands. </p>
  
  <p>My actual command is:</p>
  
  <pre><code>echo "y" | $ANDROID_HOME/tools/bin/sdkmanager "platforms;android-27"
  </code></pre>
  
  <p>And also I am commenting multiple lines togeather with <code>&amp;&amp;</code>. So It results in something like this:</p>
  
  <pre><code>echo "y" | $ANDROID_HOME/tools/bin/sdkmanager "platforms;android-27" &amp;&amp; \
  echo "y" | $ANDROID_HOME/tools/bin/sdkmanager "tools" "platform-tools"
  </code></pre>
  
  <p>But, the command (<code>$ANDROID_HOME/tools/bin/sdkmanager "platforms;android-27"</code>) displays a large license file on screen and it results in a large log file, which ultimately exceeds the log file limit where I am trying to run. </p>
  
  <p>To avoid this, I wanted pass the output to <code>/dev/null</code>. So, I tried it with:</p>
  
  <pre><code>echo "y" | $ANDROID_HOME/tools/bin/sdkmanager "platforms;android-27" &amp;&amp; \
  echo "y" | $ANDROID_HOME/tools/bin/sdkmanager "tools" "platform-tools" &gt; /dev/null 2&gt;&amp;1 &amp; 
  </code></pre>
  
  <p>It results in licences not being accepted which it should. </p>
  
  <p>How can I do this?</p>