#!/bin/bash Here=$1 Log=$2 Method=$3 mkdir $Here/results/$Method for i in *.csv do ./blab "$i " stem=${i/\.*/} grep $stem $Log | gawk -f mwu.awk Method=$Method RanksFileName=$Here/results/$Method/"ranks_"$stem done