Hello, I have finally learned how to write a Custom Fact; and duplicated
the syntax several times over inside the same .rb file.

I am using syntax that looks like the following:

Facter.add('qty_monitors_total') do
      setcode  do
             Facter::Util::Resolution.exec('/bin/grep " connected"
/var/log/Xorg.0.log | cut -d\) -f2,3,4 | grep GPU |sort -u | wc -l')
      end
end

I don't know of any other way to do this yet; but that's not my concern yet.

What I would like to know is how can I use an awk command within the
Facter::Util::Resolution.exec('.........') line.

I have a need to essentially reproduce the line above *but drop   wc -l and
add awk '{ print $2"_"$3"_on_"$1$4 }'*

I need the awk command to pretty much look like this; the problem is awk
uses its own single quotes (') and it will break the ruby code.

I am not a ruby developer; so if someone could either tell me:

   1. It's just not possible; or
   2. *do it this way*


That would be greatly appreciated.  Thank you,
--------------------------
Warron French

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/CAJdJdQmZXQAd%2Bo%2Bnp-NHqxGHnXubf%2Bac-dP5FPoy4QYMEVuBuA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to