简体   繁体   English

我通过完整命令使用制表符完成编写了一个 bash 文件,但在 zsh 中它不起作用

[英]I write a bash file using tab-completion by complete command, but in zsh it didn't work

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.当我运行 ./test.bash 时,会显示当前目录的文件列表。

complete command doesn't work in zsh??完整的命令在 zsh 中不起作用??

Bash and Zsh are two different shells though they share quite a lot of common syntax. Bash 和 Zsh 是两种不同的 shell,尽管它们有很多共同的语法。 But you simply cannot expect all Bash things to work in Zsh.但是你不能指望所有的 Bash 东西都能在 Zsh 中工作。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM