Task is not working as expected

I have written one of the smallest task, still it is not working as intended :frowning:
it is as follows

run echo 0 >/selinux/enforce

It says completed and log file I can see, the command executed and succeeded. But if I check the file manually, I can still see that its not changed. It is still 1. Where am I doing wrong in this?

does this work if you execute it on the command line / terminal as root? Make sure it works there first.

I have executed in command line as root. It works fine. Thats what surprising.

I think redirection requires a shell. Try something like this:

appendfile #!/bin/sh
appendfile echo 0 > /selinux/enforce
wait chmod 777 __appendfile
wait ./__appendfile

1 Like

I think you are correct that it requires a shell, but it does not require a shell script.

Something like:

wait sh echo 0 >/selinux/enforce
3 Likes

Thank you all for your responses.