Skip to content

Instantly share code, notes, and snippets.

@aic25
Created January 7, 2019 22:39
Show Gist options
  • Save aic25/64319a34399fcb75c1d69baa12ce2d92 to your computer and use it in GitHub Desktop.
Save aic25/64319a34399fcb75c1d69baa12ce2d92 to your computer and use it in GitHub Desktop.
Average taker
#!/bin/bash
sum=$(ls -l *.dat | wc -l)
paste -d" " *.dat | 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