Question: This is breaking 

```
alias f='git flow feature'
complete -F __git_flow_feature f

```

It works eventually (after 2 'tabs') but throws an error on each 'tab' press. 

```
-bash: [: 1: unary operator expected

```

Any ideas?

Answer: 
It works for me, when I do:

1. wget <http://www.triquanta.nl/sites/default/files/git-flow.bash>
2. source git-flow.bash
3. alias f='git flow feature'
4. complete -F \_\_git\_flow\_feature f
5. f `tab``tab`

Anyhow, the most common reason for the *"[: 1: unary operator expected"* error is that you have in the shell script code like:

```
if [ 1 = $MYVAL ] 

```

and your `MYVAL` is not set. Inspect your completion functions. You can add `set -x` to debug it.

Usually the easiest solution is to quote the variable so the operator will get the empty argument, but will have correct number of arguments:

```
if [ 1 = "$MYVAL" ] 

```
Why don't just use [git-flow-completion](https://github.com/bobthecow/git-flow-completion)? The instructions for *bash* are:

```
$ cd /etc/bash_completion.d
$ sudo wget https://raw.githubusercontent.com/bobthecow/git-flow-completion/master/git-flow-completion.bash
$ exec $SHELL

```

there are also instructions for [zsh](https://github.com/bobthecow/git-flow-completion#installation-for-zsh) or [fish](https://github.com/bobthecow/git-flow-completion#installation-for-fish).