#make a habit of wrapping array expansion in quotes. #try to reduce things like grep | head | cut #try to reduce UUOC and UUOE #oldfile command | command2 - | command3 - | command4 - > tmpfile && mv tmpfile oldfile #[ "$name" ] || { echo "Missing name."; continue; } #if [ ! -n "$name" ] || [ ! -n "$command" ] || [ ! -n "$description" ] ; then echo "error, empty necessary option, continuing with next script"; continue; fi <-- nasty usability problem #cat "$xmlfile" > "$tempfile" #the greatest speedup will come from reducing those grep | head | cut pipelines #you'll gain better security from getting rid of tempfiles