added link and credit to the guy who did this in bash