I have a simple bash script where I generate some temporary files using split, do some processing and then try to track down all the files at the end and merge them
rand_int=$RANDOM
split -d -l $n_lines_split $1 $rand_int #works fine
for f in $(find . -amin -200 -regex '.*$rand_int.*' ); do
(some processing here) ;
done
My problem is that in the find command $rand_int is interpreted literally, whereas I want to use the variable's value.