From 2e9a4d4f5a2057c62dc451e355d022025ae12a57 Mon Sep 17 00:00:00 2001 From: Vivien Delmon Date: Tue, 27 Dec 2011 13:42:20 +0100 Subject: [PATCH] Remove tmp files - Remove tmp files after executing the script - use mktemp instead of /tmp/$RANDOM --- scripts/pts_to_landmarks.sh | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) 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 -- 2.47.1