Entering edit mode
23 months ago
sharmatina189059
▴
110
for FILE in home/tinas/MAGs_12_example_data/12_MAGs_seq.fna/dir_extension_checkm/tina/prokka_annotation/**/*.gff
do
cp $FILE /home/tinas/MAGs_12_example_data/12_MAGs_seq.fna/dir_extension_checkm/tina/prokka_annotation/all_gff_file/
done
This command is working fine in terminal but in bash script this shows No such file or directory. Can anybody help me out with this command?
Hi, not sure why this loop is necessary. cp can copy multiple files at once.
cp /home/.../*.gff /home/.../destination
works, note you are lacking a single "/" in your source dir.After you have run this for the first time, if you run it again, you will get an error that you are trying to copy a file onto itself.
I tried
cp **/*.gff /home/tinas/MAGs_12_example_data/12_MAGs_seq.fna/dir_extension_checkm/tina/prokka_annotation/all_gff_file/
in bash script but it was not working.cp */*.gff
otherwise you will copy the hidden file.gff