This service will be undergoing maintenance at 00:00 UTC, 2017-10-23 It is expected to last about 30 minutes
Bug 1254416 - bash tab completion fails with "grep: Invalid range end"
bash tab completion fails with "grep: Invalid range end"
Product: GlusterFS
Classification: Community
Component: cli (Show other bugs)
Unspecified Unspecified
unspecified Severity unspecified
: ---
: ---
Assigned To: ankit
: Triaged
Depends On: 1243108 1318750
  Show dependency treegraph
Reported: 2015-08-18 00:57 EDT by Niels de Vos
Modified: 2017-03-08 05:50 EST (History)
2 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: 1243108
Last Closed: 2017-03-08 05:50:28 EST
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description Niels de Vos 2015-08-18 00:57:45 EDT
+++ This bug was initially created as a clone of Bug #1243108 +++
+++                                                           +++
+++ Use this bug to backport the change(s) from Bug #1243108  +++

With glusterfs-cli installed, bash tab completion fails to work and prints an error message:

$ gluster volgrep: Invalid range end

I have tested 3.6.3 and 3.7.2, both of which exhibit the problem.

The problem is caused by the ordering of characters within an egrep bracket expression in the "_gluster_completion()" function defined in /etc/bash_completion.d/gluster.  The file contains this line:

      egrep -ao --color=never "([A-Za-z0-9_-.]+)|[[:space:]]+|." |  \

And egrep is interpreting the "-" character in that bracket expression as indicating a range is being requested, "_-." Fortunately, "_" actually comes after ".", this range expression is invalid, and egrep throws the error instead of silently not doing what was intended.

The fix is simply to swap the positions of "-" and "." in that bracket expression:

      egrep -ao --color=never "([A-Za-z0-9_.-]+)|[[:space:]]+|." |  \

With this change, bash tab completion works as intended.

--- Additional comment from Ravishankar N on 2015-07-21 14:16:44 CEST ---

Triaged this bug as a part of the weekly meeting. Paul, would you like to send a patch for this?  The workflow is here

--- Additional comment from Anand Avati on 2015-08-18 06:03:05 CEST ---

REVIEW: (Swap order of characters in egrep bracket expression to fix Bug 1243108.) posted (#1) for review on master by Anonymous Coward (
Comment 1 Kaushal 2017-03-08 05:50:28 EST
This bug is getting closed because GlusteFS-3.7 has reached its end-of-life.

Note: This bug is being closed using a script. No verification has been performed to check if it still exists on newer releases of GlusterFS.
If this bug still exists in newer GlusterFS releases, please reopen this bug against the newer release.

Note You need to log in before you can comment on or make changes to this bug.