title: BASH SCRIPT: copy many files (same name) contained in different father folder
body: <p>I tried to turn into a bash script the Jaypal answer
  (<a href="https://stackoverflow.com/questions/9021931/copy-many-files-same-name-contained-in-different-father-folder/9022744#9022744">see here</a>)
  in this way:</p>
  
  <pre><code>#!/bin/bash
  pwd
  mkdir -v ../g
  shopt -s globstar
  for file in ./**/file.txt
  do
      echo "will copy $file"
      cp -v --parents "$file" ../g
  done
  </code></pre>
  
  <p>But it doesn't work! (It only creates the empty folder g)<br>
  What could the problem be?<br>
  note: the script is in f folder  </p>
  
  <p>Thanks! :)</p>