File: remove-unless

package info (click to toggle)
libstxxl 1.4.0-3
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 5,256 kB
  • ctags: 6,830
  • sloc: cpp: 39,594; ansic: 4,217; perl: 566; sh: 555; xml: 174; makefile: 21
file content (12 lines) | stat: -rwxr-xr-x 168 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
#!/bin/sh

test $# = 3 || exit 1

file="$1"
bn=`dirname "$file"`/`basename "$1" "$2"`
predep="$bn$3"

if [ ! -e "$predep" ]; then
	echo "rm -f $file"
	rm -f "$file"
fi