Source file : ~/SCRIPTS/script
Destination directory : ~/TMP/LAB
the command should be something like : <command> <option> ~/SCRIPTS/script ~/TMP/LAB
Desired result after the command : ~/TMP/LAB/SCRIPTS/script
There's no point in doing
<command> <option> ~/SCRIPTS/script ~/TMP/LAB/SCRIPTS/
Because I'll have to edit the command each time I change the source file. Basically I want the command to create the dirs based on the structure it finds in the source, not based on the target I desire to create.
The command should :
- create ~/TMP/LAB/SCRIPTS/
- copy ~/SCRIPTS/script to it.
cp --parents
does that, but only when copying directories
I don't know if install
can do that for me? or maybe rsync
?
cp -r ~/SCRIPTS ~/TMP/LAB
?cp --parents
, it works when copying files as well.