From aeff226c587ec52adfdadc707ab97028c7ccaf9d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Igor=20Gali=C4=87?= Date: Tue, 26 Jul 2016 00:01:57 +0200 Subject: only use awk, instead of grep and awk (#9) This reduces a pipe, by only using `awk` for both of operations that of `grep`, and that of `awk`. --- lib/facter/systemd.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/facter/systemd.rb b/lib/facter/systemd.rb index b4b11fb..d488efb 100644 --- a/lib/facter/systemd.rb +++ b/lib/facter/systemd.rb @@ -30,6 +30,6 @@ end Facter.add(:systemd_version) do confine :systemd => true setcode do - Facter::Core::Execution.exec("systemctl --version | grep 'systemd' | awk '{ print $2 }'") + Facter::Core::Execution.exec("systemctl --version | awk '/systemd/{ print $2 }'") end end -- cgit v1.2.3