I\'m writing script for git hook and have trouble with if statement inside while.
if
while
File:
#!/bin/sh while read oldrev newref
if [ "a" == "a" ] should be if [ "a" = "a" ].
if [ "a" == "a" ]
if [ "a" = "a" ]
bash accepts == instead of =, but your /bin/sh probably isn't bash.
bash
==
=
/bin/sh
So either change the == to =, or your shebang to #!/bin/bash
#!/bin/bash