title: Why does sed leave many files around?
body: <p>I noticed many files in my directory, called "sedAbCdEf" or such.</p>
  
  <ul>
  <li>Why does it create these files?</li>
  <li>Do these have any value after a script has run?</li>
  <li>Can I send these files to another location , e.g. <code>/tmp/</code>?</li>
  </ul>
  
  <p>Update:</p>
  
  <p>I checked the scripts until I found one which makes the files. Here is some sample code:</p>
  
  <pre><code>#!/bin/bash
  a=1
  b=`wc -l &lt; ./file1.txt`
  while [ $a -le $b ]; do
      for i in `sed -n "$a"p ./file1.txt`; do
          for j in `sed -n "$a"p ./file2.txt`; do
              sed -i "s/$i/\nZZ$jZZ\n/g" ./file3.txt
              c=`grep -c $j file3.txt`
              if [ "$c" -ge 1 ]
              then
                  echo $j &gt;&gt; file4.txt
                  echo "Replaced "$i" with "$j" "$c" times ("$a"/"$b")."
              fi
                  echo $i" not found ("$a"/"$b")."
              a=`expr $a + 1`
          done
      done
  done
  </code></pre>