` /usr/bin/ack —help > /ext/1.t` works.
ack can search r or python scripts directly, which is powerful. The problem 
is I can use ack in the console with redirection (which means not only 
interactive), but not in cron. Thank you for your reply.

On Friday, 15 September 2017 09:13:10 UTC+8, Andy Lester wrote:
>
> In the crontab file (edited with sudo crontab -e):
>
> So you’re running this under root’s user account.  My first guess would be 
> that for some reason root’s pathing can’t see ack, or maybe can’t find the 
> perl that ack needs.
>
> /usr/bin/ack "localhost" /etc/hosts > /ext/1.t
>
> You could try just invoking
>
>     /usr/bin/ack —help > /etc/1.t
>
> and see if ack runs at all.
>
> It seems ack <https://beyondgrep.com/> cannot work with cron. where is 
> the bug? BTW, grep works on this situation. Thank you.
>
> Even without this problem, I would suggest you use grep.  There’s no 
> reason that I see not to.  ack is designed for interactive use with humans, 
> and not at all for shell scripts.  
>
> Andy
>

-- 
You received this message because you are subscribed to the Google Groups "ack 
users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/ack-users.
For more options, visit https://groups.google.com/d/optout.

Reply via email to