Ask Your Question
0

not able to run Linux command using puppet

asked 2015-01-05 15:17:36 -0500

supriya gravatar image

Hi,

I am trying to run linux command using puppet. But when i run it through command line, it is working.

Here is my 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 my 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 `('
edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

answered 2015-01-06 23:13:56 -0500

GregLarkin gravatar image

If you are using the %x function, you don't also need the backtick operators surrounding your command string. Try removing them, and post any further messages here if it still doesn't work.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 2015-01-05 15:17:36 -0500

Seen: 356 times

Last updated: Jan 06 '15