a bash script for thread running.