Execute Command Output

Valued Contributor II

I created a new policy and entered the following command into "Execute Command" under Files and Processes. echo "test text goes here" >> /tmp/newpass
Sadly, when I look at /tmp/newpass, it exists, but is empty. Anyone able to explain this?


Valued Contributor II

I was able to avoid the problem by using echo "test text goes here" | tee /tmp/newpass
Still not sure why the >> didn't work. -t-

Contributor II

You are almost correct.

1>filename # Redirect stdout to file "filename." 1>>filename # Redirect and append stdout to file "filename." 2>filename # Redirect stderr to file "filename." 2>>filename # Redirect and append stderr to file "filename." &>filename # Redirect both stdout and stderr to file "filename." # This operator is now functional, as of Bash 4, final release.

So in your case it would be:

Echo "test text goes here" 1>>/tmp/newpass