This is not Perl.

Maybe I should go to bed..
Dont use $ in beginning of variable in bash.