Task: Write a script that will copy subdirectories (and all files inside) from directory A to directory B. Only directories containing pdf, tif, jpg files should be copied. The whole parent directory with subdirectories and files should be copied. The directory names may contain service symbols. Problem: I don't know how to specify the parent directory instead of the current directory.
#!/bin/bash
IFS=$'/n'
#mentioning to move the string as a delimiter instead of a space
for file -name "*.pdf" -o "*.tif" -o "*.jpg" in catalog_A/*
#loop "for" for files with a name ending in ".pdf" or ".tif" or ".jpg" in directory A
do
#loop body
echo $(pwd)
#current absolute path output
dirname="$dirname"
#upload the name of the current directory for a holistic view of its name, which may contain system symbols
cp -a . catalog_B/
#copy the current directory with attached files to directory B
done
#end of cycle