Skip to content

Commit

Permalink
profile.d: Avoid tested variable values being confused as [ ] operators
Browse files Browse the repository at this point in the history
For example with $PS1 set to ">":
$ [ -n '4.4.19(1)-release' -a -n '>' -a -z '' ]
bash: [: too many arguments

https://bugzilla.redhat.com/show_bug.cgi?id=1582703
  • Loading branch information
scop committed May 27, 2018
1 parent 02a13f7 commit 3f1c884
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion bash_completion.sh.in
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Check for interactive bash and that we haven't already been sourced.
if [ -n "${BASH_VERSION-}" -a -n "${PS1-}" -a -z "${BASH_COMPLETION_VERSINFO-}" ]; then
if [ "x${BASH_VERSION-}" != x -a "x${PS1-}" != x -a "x${BASH_COMPLETION_VERSINFO-}" = x ]; then

# Check for recent enough version of bash.
if [ ${BASH_VERSINFO[0]} -gt 4 ] || \
Expand Down

0 comments on commit 3f1c884

Please sign in to comment.