From man install
:
-D create all leading components of DEST except the last, or all components of --target-directory, then copy SOURCE to DEST
-m, --mode=MODE
set permission mode (as in chmod), instead of rwxr-xr-x
I wasn’t sure if my interpretation, that -D
made parents and the -m
set the perms for the file, was entirely correct, so:
% ls -l
total 20
-rw-r--r-- 1 dm dm 16743 Oct 8 10:40 env
% install -Dm644 env testy2/env
% ls -l
total 24
-rw-r--r-- 1 dm dm 16743 Oct 8 10:40 env
drwxr-xr-x 2 dm dm 4096 Oct 8 10:42 testy2
ls -l testy2
total 20
-rw-r--r-- 1 dm dm 16743 Oct 8 10:42 env