From: Vivien Delmon Date: Tue, 27 Dec 2011 12:42:20 +0000 (+0100) Subject: Remove tmp files X-Git-Tag: v1.3.0~129 X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=commitdiff_plain;h=2e9a4d4f5a2057c62dc451e355d022025ae12a57;p=clitk.git Remove tmp files - Remove tmp files after executing the script - use mktemp instead of /tmp/$RANDOM --- diff --git a/scripts/pts_to_landmarks.sh b/scripts/pts_to_landmarks.sh index 87bc9ee..e93cbe4 100755 --- a/scripts/pts_to_landmarks.sh +++ b/scripts/pts_to_landmarks.sh @@ -12,10 +12,11 @@ if [ $# -ne 2 ]; then echo "Usage: $0 input.pts output.txt" 1>&2 + exit 1 fi -to_append=/tmp/$RANDOM -to_prepend=/tmp/$RANDOM +to_append=`mktemp` +to_prepend=`mktemp` for i in $(seq 0 $((`cat $1 | wc -l` - 1))); do @@ -25,3 +26,5 @@ done echo "LANDMARKS1" > $2 paste -d ' ' $to_prepend $1 $to_append >> $2 + +rm $to_append $to_prepend