From: Micah Hoffmann Date: 2013-05-10T23:51:52+09:00 Subject: Help convert sh -> rb Hello, I am new to the forum and ruby, thank you for any help you may have. The goal I am trying to accomplish is converting this shell script into a ruby script. What the script does is run the "rds-describe-db-instances" command then pull out two variables and input them into the JSON output. Any help would be great, thanks. #!/bin/sh echo " { \"checks\": {" rds-describe-db-instances|awk '$1 == "DBINSTANCE" { print $6,$9 }'| while read S I; do echo " \"mysql_disk_usage_$I\": { \"handlers\": [\"default\",\"mailer_alerts\"], \"command\": \"/etc/sensu/plugins/mysql-disk.rb -h$I u -p -s$S\", \"interval\": 300, \"occurrences\": 1, \"subscribers\": [ \"urls\" ] }," done echo "}}" -- Posted via http://www.ruby-forum.com/.