in reply to parsing etime field from solaris ps
To This:$hh += 0; # stop warning as $hh may not be initialised $dd += 0; # same as $hh :) $etime_secs= $ss+($mm*60)+($hh*60*60)+($dd*24*60*60);
Note that undefined or 0, it does not matter that it returns 0 with the ternary operator (0*anything = 0, anyway).$etime_secs= $ss+($mm*60)+($hh?$hh*60*60:0)+($dd?$dd*24*60*60:0);
-enlil
|
|---|