Bug 42774

Summary: xdg-screensaver should use grep -q option
Product: Portland Reporter: Tanguy Ortolo <tanguy+freedesktop>
Component: xdg-utilsAssignee: Portland Bugs <portland-bugs>
Status: RESOLVED MOVED QA Contact:
Severity: enhancement    
Priority: medium    
Version: unspecified   
Hardware: Other   
OS: All   
URL: http://bugs.debian.org/647793
Whiteboard:
i915 platform: i915 features:

Description Tanguy Ortolo 2011-11-10 02:23:26 UTC
Hello,

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.
Comment 1 GitLab Migration User 2019-02-16 13:31:11 UTC
-- GitLab Migration Automatic Message --

This bug has been migrated to freedesktop.org's GitLab instance and has been closed from further activity.

You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.freedesktop.org/xdg/xdg-utils/issues/51.

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.