[Bug 264976] crontab task fail to work if stdout redirected

From: <bugzilla-noreply_at_freebsd.org>
Date: Fri, 01 Jul 2022 12:24:01 UTC
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=264976

            Bug ID: 264976
           Summary: crontab task fail to work if stdout redirected
           Product: Base System
           Version: 13.1-STABLE
          Hardware: amd64
                OS: Any
            Status: New
          Severity: Affects Only Me
          Priority: ---
         Component: conf
          Assignee: bugs@FreeBSD.org
          Reporter: dcheshkov@gmail.com

The following periodic task fail to work if stdout/stderr redirection appended.
*/5 * * * * /bin/date | /usr/local/bin/test2 > & /dev/null
- not work, but
*/5 * * * * /bin/date | /usr/local/bin/test2
works well.

And 
/bin/date | /usr/local/bin/test2 > /dev/null 2>&1
resulted in 'Ambiguous output redirect'.

/usr/local/bin/test2 - just short perl script:
#!/usr/local/bin/perl
open(OUT, ">>/var/log/test.log");
print OUT <STDIN>;
close(OUT);
exit(0);

So, how make periodic tasks like this to work? This issue arose after migration
from 12.3-STABE to 13.1-STABLE.

Whith best regards,
Dmitry Cheshkov

-- 
You are receiving this mail because:
You are the assignee for the bug.