-3

source code:

#!/bin/bash

complete -W 'word1 word2 word3 aa bb' ./test.bash
echo "the param is: $1"

When I run ./test.bash , turns out the file list of current dir.

complete command doesn't work in zsh??

dbc
  • 104,963
  • 20
  • 228
  • 340
fujian26
  • 70
  • 7

1 Answers1

1

Bash and Zsh are two different shells though they share quite a lot of common syntax. But you simply cannot expect all Bash things to work in Zsh.

  • Google: zsh auto complete –  Nov 22 '17 at 10:50
  • @fujian26 `zsh` has completion facilities, but they are very different from `bash`'s. See `man zshcompwid`, `man zshcompsys`, and `man zshcompctl`. – chepner Nov 22 '17 at 16:13