too much C coding broke my shell script
fix shell script