Austin Schuh | 3333ec7 | 2022-12-29 16:21:06 -0800 | [diff] [blame^] | 1 | #!/bin/sh -e |
2 | |||||
3 | # Usage: install.sh TARGET [RELATIVE PATHS ...] | ||||
4 | # | ||||
5 | # e.g. ./install.sh /usr/local foo/file1 foo/file2 ... | ||||
6 | # This creates the files /usr/local/foo/file1 and /usr/local/foo/file2 | ||||
7 | |||||
8 | TARGETDIR=$1 | ||||
9 | shift | ||||
10 | |||||
11 | for src in "$@"; do | ||||
12 | dest=$TARGETDIR/$src | ||||
13 | mkdir -p $(dirname $dest) | ||||
14 | cp $src $dest | ||||
15 | echo $dest | ||||
16 | done |