Bug 42774 - xdg-screensaver should use grep -q option
Summary: xdg-screensaver should use grep -q option
Status: NEW
Alias: None
Product: Portland
Classification: Unclassified
Component: xdg-utils (show other bugs)
Version: unspecified
Hardware: Other All
: medium enhancement
Assignee: Portland Bugs
QA Contact:
URL: http://bugs.debian.org/647793
Depends on:
Reported: 2011-11-10 02:23 UTC by Tanguy Ortolo
Modified: 2011-11-10 02:23 UTC (History)
0 users

See Also:
i915 platform:
i915 features:


Note You need to log in before you can comment on or make changes to this bug.
Description Tanguy Ortolo 2011-11-10 02:23:26 UTC

In xdg-screensaver, there are several calls to grep in if control sequences conditions. In order not to get the output of grep, its standard output is redirected to /dev/null.

grep has a -q option that is precisely done for that purpose; in addition it is a bit faster since it exists on the first match since it has no need to wait to the end of its input.

I suggest that you replace all the “grep >/dev/null” by “grep -q”. In addition, the stderr redirections should be removed since they are useful: if an error occurs, it seems more useful to show it rather than hide it.

This has been the object of a bug report for Debian, which I have put in the URL field of this one. There is a patch attached; it is only a first shot which may not be suitable (it removes stderr redirections but adds a -s option which is not very useful) but I can adapt it.

Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.