Skip to content
GitLab
Projects Groups Topics Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
  • Register
  • Sign in
  • L linux
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributor statistics
    • Graph
    • Compare revisions
  • Issues 0
    • Issues 0
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 0
    • Merge requests 0
  • Deployments
    • Deployments
    • Releases
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Commits
  • Issue Boards
Collapse sidebar
  • Kirill Smelkov
  • linux
  • Repository
  • linux
  • scripts
  • setlocalversion
Find file BlameHistoryPermalink
  • Roland Dreier's avatar
    setlocalversion: Use "grep -q" instead of piping output to "read dummy" · 7f3bd6c9
    Roland Dreier authored Mar 23, 2012
    In some circumstances (eg when running a build in an emacs shell
    buffer), I get a spew of messages like
    
        grep: writing output: Broken pipe
    
    from setlocalversion, because the "read" subshell apparently exits as
    soon as it reads one line and gives EPIPE to grep.  It's not clear to
    me why this way of writing the check was used instead of just using
    grep -q to suppress output, but unless there is some deep reason I
    don't know, this way looks cleaner to me anyway, and gets rid of the
    ugly message spew.
    
    (I double checked at http://pubs.opengroup.org/onlinepubs/009604499/utilities/grep.html
    
    
    and "grep -q" is specified in POSIX / SuS, so hopefully even people
    cross-compiling the kernel on some bizarre host OS can't complain
    about this change)
    
    Signed-off-by: default avatarRoland Dreier <roland@purestorage.com>
    Signed-off-by: default avatarMichal Marek <mmarek@suse.cz>
    7f3bd6c9
GitLab Nexedi Edition | About GitLab | About Nexedi | 沪ICP备2021021310号-2 | 沪ICP备2021021310号-7