I tried to turn into a bash script the Jaypal answer
([see here](https://stackoverflow.com/questions/9021931/copy-many-files-same-name-contained-in-different-father-folder/9022744#9022744))
in this way:

```
#!/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

```

But it doesn't work! (It only creates the empty folder g)  

What could the problem be?  

note: the script is in f folder 

Thanks! :)