reorganization, and output filename for SimpleWeb

This commit is contained in:
q
2015-12-20 12:31:29 +02:00
parent 810d485755
commit 9869257aaa
18 changed files with 16 additions and 15 deletions

24
files/rm_bg Executable file
View File

@@ -0,0 +1,24 @@
#!/bin/bash
set -e
function helpexit() {
echo Delete files in background, by moving the to a temp folder first.
echo This command is always recursive!
exit
}
[[ -z "$1" ]] && helpexit
[[ "$1" = "-h" ]] && helpexit
tempfolders=()
for f in "$@"; do
d=$( readlink -nf $( dirname "$f" ) )/.rm_bg.$$
mkdir -p "$d"
mv $f "$d"/
tempfolders+=( "$d" )
done
(
for (( i=0; $i<${#tempfolders[@]}; i++ )); do
rm -rf "${tempfolders[$i]}"
done
) &