forked from ungleich-public/cdist
write script to generate outdir from filelist
Signed-off-by: Nico Schottelius <nico@wurzel.schottelius.org>
This commit is contained in:
parent
9f3a8c0956
commit
75e3f3c90f
5 changed files with 60 additions and 0 deletions
18
hacking/filelist_to_dir.sh
Executable file
18
hacking/filelist_to_dir.sh
Executable file
|
|
@ -0,0 +1,18 @@
|
|||
#!/bin/sh
|
||||
|
||||
if [ "$#" -ne 1 ]; then
|
||||
echo "$0 outdir"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
outdir=$1; shift
|
||||
|
||||
mkdir -p "$outdir"
|
||||
|
||||
while read file; do
|
||||
if [ -d "$file" ]; then
|
||||
mkdir -p "$outdir$file"
|
||||
else
|
||||
cp --preserve=mode,links "$file" "$outdir$file"
|
||||
fi
|
||||
done
|
||||
Loading…
Add table
Add a link
Reference in a new issue