I have a bash script I'm trying to write I have 2 base directories:
- ./tmp/serve/
- ./src/
I want to go through all the directories in ./tmp and copy the *.html files into the same folder path in ./src
i.e if I have a html file in ./tmp/serve/app/components/help/ help.html --> copy to ./src/app/components/help/ And recursively do this for all subdirectories in ./tmp/
NOTE: the folder structures should exist so just need to copy them only. If it doesn't then hopefully it could create the folder for me (not what I want) but with GIT I can track these folders to manually handle those loose html files.
I got as far as
echo $(find . -name "*.html")\n
But not sure how to actually extract the file path with pwd and do what I need to, maybe it's not a one liner and needs to be done with some vars.