bash script for basic feature extraction