your shit is full of bashisms, at least shebang it properly.