switch from ruby script to bash