On Sun, Jun 07, 2020 at 06:40:41AM +0200, Sebastien Marie wrote:
> On Sat, Jun 06, 2020 at 07:57:35PM +0200, BESSOT Jean-Michel wrote:
> > yes, "reboot"
> >
> > On 2020-06-06 17:51, Otto Moerbeek wrote:
> > > On Sat, Jun 06, 2020 at 05:44:24PM +0200, BESSOT Jean-Michel wrote:
> > >
> > > > I did run grep reboot and grep -i reboot in /usr/src/usr.sbin/cron/
> > > So did you give a file argument?
> > >
>
> Just a try.
>
> If you just did:
>
> $ cd /usr/src/usr.sbin/cron
> $ grep -i reboot
>
> It is expected that the command do nothing obvious.
>
> For quoting the grep(1) manual:
>
> If no file arguments are specified, the standard input is used.
>
>
> If you want grepping for files inside the current directory, you should also
> pass -R option:
>
> Recursively search subdirectories listed. If no file is given,
> grep searches the current working directory.
>
> Please note that the behaviour of the last part 'If no file is given, ...' is
> present in 6.7 and not in 6.6 (changed on 2019-12-02 with c1cbe94b).
I think you are confused here, grep has always looked at stdin if only
a pattern is given on the command line. What changed was the -r case,
which now defaults to while previously an argument was required.
-Otto
>
> Thanks.
> --
> Sebastien Marie