example shell script to compute LD