bash compatability

modifying scripts for better bash compatability across platforms