#!/bin/bash

# Instructions for how to use this script are provided in the README.

path=$*

echo "# u_L2 p_L2 rho_L2" | tee annulus.txt

for i in $path; do
  ul2=`grep "Error_u_l2" $i/statistics | gawk '{ print $2}' | sed s/.$//`
  pl2=`grep "Error_p_l2" $i/statistics | gawk '{ print $2}' | sed s/.$//`
  rhol2=`grep "Error_rho_l2" $i/statistics | gawk '{ print $2}' | sed s/.$//`
  tail -1 $i/statistics | gawk "{ print \$${ul2} \" \" \$${pl2} \" \" \$${rhol2}}" | tee -a annulus.txt
done
