title: not able to append to a file using bash script
body: <p>This is my code:</p>
  
  <pre><code>#!/bin/bash -e
  dirs=( * )
  for f in "${dirs[@]}"
  do
    while IFS= read -r line; do
       case "$line" in
         *disabled\&gt;true* )
            sed -i '1i "$f"' list.txt;;
       esac
    done &lt; "$f/config.xml"
  done
  </code></pre>
  
  <p>Instead of sed, I tried echo and printf too but the the file list.txt is always empty. Why am I not able to append to file? </p>
  
  <pre><code>echo "$f" &gt;&gt; list.txt;;
  printf '%s\n' "$f" &gt;&gt; list.txt;;
  </code></pre>
  
  <p>sample config.xml file under test folder:</p>
  
  <pre><code>&lt;?xml version='1.0' encoding='UTF-8'?&gt;
  &lt;project&gt;
  &lt;disabled&gt;true&lt;/disabled&gt;
  &lt;/project&gt;
  </code></pre>
  
  <p>Goal: Print "test" into list.txt, if test/config.xml has <code>&lt;disabled&gt;true</code> in it.</p>