Project

General

Profile

« Previous | Next » 

Revision 8707

bin/in_place: don't run if no command to run, because that would erase the file

View differences:

in_place
5 5
file="$1"
6 6
shift
7 7

  
8
test "$#" -ge 1 || exit 0 # no command to run
9

  
8 10
temp="$(tempfile)"
9 11
onExit () { rm -f "$temp"; }
10 12
trap onExit EXIT

Also available in: Unified diff