bash to ruby