POSIX compatibility

changed to shebang sh. some changes like operators, formatings ...