Looks like your Ruby syntax is incorrect.
Try (untested):
*%x{/usr/bin/diff <(/bin/sort /home/weblogic/javafoundmodified.txt)
<(/bin/sort /home/weblogic/authorizedjava.txt) >
/home/weblogic/unknownjava.txt | /bin/sed -i 's/^.//'
/home/weblogic/unknownjava.txt}*
*You might want to throw that in IRB before putting it in Facter directly
just to make sure it does what you expect.Trevor*
On Mon, Jan 5, 2015 at 2:33 PM, Spriya <[email protected]> wrote:
> Hi,
>
> I am trying to run linux command through puppet. when i run the same
> command in the command line it is working fine. But when i placed it in the
> puppet it is throwing me an error.
>
> Here is the code:
>
> *Facter.add('unknownjava') do*
> * setcode do*
> * %x(`/usr/bin/diff <(/bin/sort
> /home/weblogic/javafoundmodified.txt) <(/bin/sort
> /home/weblogic/authorizedjava.txt) > /home/weblogic/unknownjava.txt |
> /bin/sed -i 's/^.//' /home/weblogic/unknownjava.txt`)*
> * end*
> * end*
>
>
> Here is the error:
> *sh: command substitution: line 0: syntax error near unexpected token `('*
> *sh: command substitution: line 0: `/usr/bin/diff <("/bin/sort
> /home/weblogic/javafoundmodified.txt") <("/bin/sort
> /home/weblogic/authorizedjava.txt") > /home/weblogic/unknownjava.txt |
> /bin/sed -i 's/^.//' /home/weblogic/unknownjava.txt'*
> *sh: command substitution: line 0: syntax error near unexpected token `('*
>
>
>
> --
> 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/8b32a0d5-f06a-4598-9f72-b5a3aca4a610%40googlegroups.com
> <https://groups.google.com/d/msgid/puppet-users/8b32a0d5-f06a-4598-9f72-b5a3aca4a610%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>
--
Trevor Vaughan
Vice President, Onyx Point, Inc
(410) 541-6699
[email protected]
-- This account not approved for unencrypted proprietary information --
--
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/CANs%2BFoW_Uj3BbOmcMkemqKDgMT9MOazDAhXGVJLoJ6kLk%3Dqn8A%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.