From: Fosiul Alam Date: 2012-08-16T05:24:02+09:00 Subject: Re: string processing #!/usr/bin/ruby # host=ARGV[0] puts host cmd=`php -q /var/lib/cacti/cli/add_device.php --description="#{host}" --ip="#{host}" --template=1 --community="public"` cmd.each do |line| if line =~ /^Success - new device-id: \((\d+)\)/ device_id=$i end end puts device_id ======== this does not give anything .. # So now i will have to use hte device_id valu to execute another commands. -- Posted via http://www.ruby-forum.com/.