#!/bin/sh # # Collects last lines from different ecut dirs into results${suf} for plotting . suffix if [ -z "$2" ]; then echo "Usage: $0 " echo "e.g. ./$0 /tmp/C2H6 sigma_i0_t1" exit 1 fi ecuts=1 i=1 while [ "$i" -lt 128 ]; do let i=$i+1 ecuts="$ecuts $i" done #echo $ecuts #exit 1 . suffix RES="${1}/results-$2${suf}" DATE="`date`" echo "# Results of variable $2 from molecule $1, gathered on $date" >$RES # gather last lines for i in $ecuts; do if [ -e "${1}/${i}Ht/pcp.${2}${suf}" ]; then tail -n 1 ${1}/${i}Ht/pcp.${2}${suf} >>$RES 2>>/dev/null fi done exit 0