commit 204f906b057c985cd905e820995c9a87c18d884b parent aa6e7dbb877172c9075dcf5c3fa1762687a17d63 Author: Suraj N. Kurapati <sunaku@gmail.com> Date: Tue, 26 Sep 2006 11:10:44 -0700 [project @ 0a3c43ba06e3f8346f0b7acc70499a55b5847d63] better way to write the code :-) Diffstat:
wmiirc | | | 7 | ++++--- |
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/wmiirc b/wmiirc @@ -36,9 +36,10 @@ LOG = Logger.new(__FILE__ + '.log', 5) LOG.info "starting" # terminate existing instances - pidList = `ps -C #{File.basename $0} -o pid`.split.map! {|s| s.to_i} - pidList.shift # discard header - pidList.reject! {|pid| pid == $$} + pidList = `ps -C #{File.basename $0} -o pid`. + split[1..-1]. # discard header from `ps` output + map! {|s| s.to_i}. + reject! {|pid| pid == $$} pidList.each do |pid| LOG.info "stopping loader #{pid}"