FreeBSD Bugzilla – Attachment 204872 Details for
Bug 238380
zgrep: Allow multiple options '-e'
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
Patch
patch-zgrep.sh.txt (text/plain), 1.26 KB, created by
Ganael LAPLANCHE
on 2019-06-07 10:15:07 UTC
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Ganael LAPLANCHE
Created:
2019-06-07 10:15:07 UTC
Size:
1.26 KB
patch
obsolete
>Index: usr.bin/grep/zgrep.sh >=================================================================== >--- usr.bin/grep/zgrep.sh (revision 348774) >+++ usr.bin/grep/zgrep.sh (working copy) >@@ -29,6 +29,7 @@ > zcat=zstdcat > > endofopts=0 >+pattern="" > pattern_found=0 > grep_args="" > hyphen=0 >@@ -83,10 +84,7 @@ > fi > case $1 in > -e) >- pattern="$2" > pattern_found=1 >- shift 2 >- break > ;; > *) > ;; >@@ -143,7 +141,11 @@ > if [ $# -lt 1 ] > then > # ... on stdin >+ if [ -z "${pattern}" ]; then >+ ${cattool} ${catargs} - | ${grep} ${grep_args} - || ret=$? >+ else > ${cattool} ${catargs} - | ${grep} ${grep_args} -- "${pattern}" - || ret=$? >+ fi > else > # ... on all files given on the command line > if [ ${silent} -lt 1 -a $# -gt 1 ]; then >@@ -150,8 +152,13 @@ > grep_args="-H ${grep_args}" > fi > for file; do >- ${cattool} ${catargs} -- "${file}" | >- ${grep} --label="${file}" ${grep_args} -- "${pattern}" - || ret=$? >+ if [ -z "${pattern}" ]; then >+ ${cattool} ${catargs} -- "${file}" | >+ ${grep} --label="${file}" ${grep_args} - || ret=$? >+ else >+ ${cattool} ${catargs} -- "${file}" | >+ ${grep} --label="${file}" ${grep_args} -- "${pattern}" - || ret=$? >+ fi > done > fi >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 238380
: 204872