Re: [libgpiod][PATCH] tools: tests: replace egrep with grep -E

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, Jun 01, 2023 at 10:28:22PM +0800, Kent Gibson wrote:
> On Thu, Jun 01, 2023 at 04:09:50PM +0200, Bartosz Golaszewski wrote:
> > From: Bartosz Golaszewski <bartosz.golaszewski@xxxxxxxxxx>
> > 
> > Since version 3.11 egrep emits the following warning to stderr on startup:
> > 
> >   egrep: warning: egrep is obsolescent; using grep -E
> > 
> > This makes the tests fail (though that seems to depend on BATS version)
> > so replace egrep with grep -E as suggested.
> > 
> 
> That works for me, so I don't have any objections.
> 
> Though FWIW, my global sim cleanup script looks like:
> 
> find /sys/kernel/config/gpio-sim -type d -name hog -print0 2>/dev/null | xargs -0 -r rmdir
> find /sys/kernel/config/gpio-sim -type d -name "line*" -print0  2>/dev/null | xargs -0 -r rmdir
> find /sys/kernel/config/gpio-sim -type d -name "bank*" -print0 2>/dev/null | xargs -0 -r rmdir
> rmdir /sys/kernel/config/gpio-sim/*
> 
> So no grep at all, just find and xargs.

Maybe you can even use -exec... :-)
But I don't remember if it forks for each entry (and I don't remember by heart
what -r does for xargs, which usually adds as many parameters as possible to
the command line of the calling tool).

> That is for all sims, but could easily be reduced to a particular sim,
> given the sim name.
> 
> Setting live to 0 seems to be optional - deleting everything works fine
> for me.

-- 
With Best Regards,
Andy Shevchenko





[Index of Archives]     [Linux SPI]     [Linux Kernel]     [Linux ARM (vger)]     [Linux ARM MSM]     [Linux Omap]     [Linux Arm]     [Linux Tegra]     [Fedora ARM]     [Linux for Samsung SOC]     [eCos]     [Linux Fastboot]     [Gcc Help]     [Git]     [DCCP]     [IETF Announce]     [Security]     [Linux MIPS]     [Yosemite Campsites]

  Powered by Linux