Whamcloud - gitweb
LU-13776 tests: make sure pjdfstest.sh writes to tmp
[fs/lustre-release.git] / lustre / tests / racer / file_link.sh
index aaf498d..264ef0f 100755 (executable)
@@ -1,10 +1,11 @@
 #!/bin/bash
+trap 'kill $(jobs -p)' EXIT
 
 DIR=$1
 MAX=$2
 
-while /bin/true ; do 
-    file=$((RANDOM % $MAX))
-    new_file=$((RANDOM % MAX))
-    ln $file $DIR/$new_file 2> /dev/null
+while true; do
+       old_path=$DIR/$((RANDOM % MAX))
+       new_path=$DIR/$((RANDOM % MAX))
+       ln $old_path $new_path 2> /dev/null
 done