Skip to content

Instantly share code, notes, and snippets.

@aic25
Created January 7, 2019 22:43
Show Gist options
  • Save aic25/2b8ee0ac1ab0ab7a4f1432ab7e71e681 to your computer and use it in GitHub Desktop.
Save aic25/2b8ee0ac1ab0ab7a4f1432ab7e71e681 to your computer and use it in GitHub Desktop.
Find BER files and copy them to manage multiprocessing.
#! /bin/bash
find -name "BER.dat" | cat -n | while read n f; do
cp "$f" "$n".xx
done
sum=$(ls -l *.xx | wc -l)
paste -d" " *.xx | awk -v s="$sum" '{
for(i=0;i<=s-1;i++)
{
t1 = 2+(i*2)
temp1 = temp1 + $t1
}
print $1" "temp1/s
temp1=0
}'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment