Linux redirection with concatenation not working in BigFix tasks

I have noticed that doing redirection of stdout with concatenation (ie. >>) does not work in BigFix tasks
eg.

delete __createfile
ls -l /opt/tivoli/cit/cache_data > /tmp/ls.out 2>&1
ls -l /etc/auto.master **>>** /tmp/ls.out
END_OF_FILE

delete my_script.sh
move __createfile my_script.sh

// wait type chmod >/tmp/type.out 2>&1
wait chmod +x ./my_script.sh
wait /bin/sh -c "./my_script.sh"
delete my_script.sh

============

ls -l /opt/tivoli/cit/cache_data > /tmp/ls.out 2>&1
is displayed in /tmp/ls.out but 
ls -l /etc/auto.master **>>** /tmp/ls.out

is not?

Does >> have some special meaning that I need to escape similar to the use of { ???

Regards … Leslie

I edited your post to add in code tags, please use the ‘Preformatted Text’ label or markdown tags so we can read the code. Thanks!

The >> symbol has no special meaning in actionscript.

Can you try to reproduce this in a simple action and paste the actual ActionScript code here? This is likely a syntax issue but what you posted isn’t the real script (I can tell because there’s no createfile until statement)

Never mind. I just tried it again and this time it worked
ie.

delete __createfile
createfile until END_OF_FILE
#!/bin/sh
ps -elf | grep -i wscan | grep -v grep > /tmp/ps.out 2>&1
date >> /tmp/ps.out 2>&1
END_OF_FILE

delete my_script.sh
move __createfile my_script.sh

// wait type chmod >/tmp/type.out 2>&1
wait chmod +x ./my_script.sh
wait /bin/sh -c "./my_script.sh"
delete my_script.sh

/tmp/ps.out contains
BODY { FONT-SIZE: 15px; OVERFLOW: auto; FONT-FAMILY: Segoe UI; FONT-WEIGHT: 400; FONT-STYLE: normal }

4 D root 37431 37009 4 80 0 - 890752 rpc_wa 11:11 ? 00:11:52 /opt/tivoli/cit/bin/wscansw -c /var/opt/BESClient/LMT/CIT/sw_config.xml -i /var/opt/BESClient/LMT/CIT/catalog.xml -o /var/opt/BESClient/LMT/CIT/1622393934_cit.xml.work -e /var/opt/BESClient/LMT/CIT/1622393934_citlog.xml
Wed Jun 18 15:10:00 EDT 2025

I could swear it wasn’t working before. Ah well.

Great to hear!

The most common problems I see around that, are handling the redirection directly on the ‘wait’ line and properly quoting both the command and the redirection. To do this at the wrapper level, instead of the redirections inside the shell script something like the following should work:

wait /bin/sh -c '"./my_script.sh" > /tmp/ps.out 2>&1'