I'm having a hard time trying to limit the path with find
.
I have this command find ${DIR_PATH} -type f -name ".py" -exec cp --parent {} ${DEST_DIR} \;
Which give me this output :
${DIR_PATH}/a/main.py
${DIR_PATH}/a/b/resources.py
${DIR_PATH}/c/__init__.py
${DIR_PATH}/c/main.py
I definitely know ${DIR_PATH}
as I am looking in this directory. How can I get :
a/main.py
a/b/resources.py
c/__init__.py
c/main.py
The objective is to get the following in the destination directory :
${DEST_DIR}/a/main.py
${DEST_DIR}/a/b/resources.py
${DEST_DIR}/c/__init__.py
${DEST_DIR}/c/main.py
But I have this instead :
${DEST_DIR}/${DIR_PATH}/a/main.py
${DEST_DIR}/${DIR_PATH}/a/b/resources.py
${DEST_DIR}/${DIR_PATH}/c/__init__.py
${DEST_DIR}/${DIR_PATH}/c/main.py
Note : DIR_PATH
and DEST_DIR
are set up at the beginning of a sh file.