From: Wybo Dekker Date: 2012-09-03T05:55:17+09:00 Subject: Re: capture system command output On 2012-09-02 22:06, Fosiul Alam wrote: > #!/usr/bin/ruby > > require 'rubygems' > `parted -s /dev/cciss/c0d12 primary 0 100%` > puts $?.to_i $?'s class is Process::Status You should use $?.exitstatus > its showing 0, but it should show 1 > > because check the command line from comand line > > parted -s /dev/cciss/c0d12 mkpart primary 0 100% > Error: Can't have overlapping partitions. > # echo $? > 1 > > then why from ruby is showing different ?? > thanks > -- Wybo