Update takeScreenShot.pl

Ported from perl to bash because ewww Perl