Same error is coming up. even though i changed to 'bash -c /usr/bin/diff ...
On Tuesday, January 6, 2015 3:42:59 AM UTC-5, garethr wrote: > > On 5 January 2015 at 19:33, Spriya <[email protected] <javascript:>> > 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 `(' > > > > I'm guessing here a little but I think this is because the command is > executing under sh, and when you run in manually it's executing under > bash. > > So try something like: > > (`bash -c /usr/bin/diff .... > > Gareth > > > > > > > -- > > 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] <javascript:>. > > To view this discussion on the web visit > > > https://groups.google.com/d/msgid/puppet-users/8b32a0d5-f06a-4598-9f72-b5a3aca4a610%40googlegroups.com. > > > > For more options, visit https://groups.google.com/d/optout. > > > > -- > Gareth Rushgrove > @garethr > > devopsweekly.com > morethanseven.net > garethrushgrove.com > -- 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/fa76ee78-e580-4f7a-816d-03783f609298%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
