Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
SUSE:SLE-12-SP2:Update
bzip2.21593
bzip2-1.0.6-bzgrep_return_value.patch
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File bzip2-1.0.6-bzgrep_return_value.patch of Package bzip2.21593
Index: bzip2-1.0.6/bzgrep =================================================================== --- bzip2-1.0.6.orig/bzgrep +++ bzip2-1.0.6/bzgrep @@ -67,8 +67,20 @@ for i do j=${j//|/\\|} j=${j//&/\\&} j=`printf "%s" "$j" | tr '\n' ' '` - bzip2 -cdfq "$i" | $grep $opt "$pat" | sed "s|^|${j}:|" - r=$? + # A trick adapted from + # https://groups.google.com/forum/#!original/comp.unix.shell/x1345iu10eg/Nn1n-1r1uU0J + # that has the same effect as the following bash code: + # bzip2 -cdfq "$i" | $grep $opt "$pat" | sed "s|^|${j}:|" + # r=${PIPESTATUS[1]} + exec 3>&1 + eval ` + exec 4>&1 >&3 3>&- + { + bzip2 -cdfq "$i" 4>&- + } | { + $grep $opt "$pat" 4>&-; echo "r=$?;" >&4 + } | sed "s|^|${j}:|" + ` fi test "$r" -ne 0 && res="$r" done
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor