Cela dépend de ce que vous avez défini comme shell (de connexion) par défaut pour le système, pour Terminal, pour iTerm. La mise à jour de Show
Cette erreur provient d'un soi-disant fichier dot que vous avez installé. Ce sont des fichiers avec un point devant (d'où le nom) comme Tous les fichiers à points du répertoire personnel de vos utilisateurs ne sont pas lus par le shell. Ceux lus par bash peuvent inclure: Ces fichiers peuvent avoir été créés par vous, manipulés par vous ou par certains programmes comme fink, homebrew ou ports. Vous venez de les copier depuis le net pour "mettre à jour" / personnaliser votre shell. Quelle que soit la façon dont vous en êtes arrivé à la situation actuelle. Ouvrez votre Terminal / iTerm depuis un autre utilisateur et les symptômes ne seront probablement pas observés. Cela signifie: tous ces fichiers sont en un sens «supprimés en toute sécurité»: dans le sens où ils ne sont pas
essentiels pour faire fonctionner votre Terminal ou votre shell. Faites une sauvegarde de ceux-ci au cas où ils contiendraient effectivement des paramètres personnalisés dont vous pourriez dépendre dans votre travail quotidien. Des exemples pour cela incluent des ajouts à vos variables Cependant, le message d'erreur que vous avez publié indique deux choses:
Vous devriez donc parcourir tous les fichiers de points de votre utilisateur actuel et ne conserver que les éléments que vous reconnaissez comme nécessaires (rappelez-vous les sauvegardes).Ensuite, vous pouvez utiliser à nouveau les fichiers mis à jour de votre source.Mais gardez à l'esprit que ceux-ci sont assez «complets».Il serait prudent de ne pas les utiliser toutes aveuglément et de tester et de choisir un sous-ensemble de toutes ces options. Les utiliser tous aveuglément ou sans discernement peut non seulement entraîner des problèmes tels que celui qui pose cette question, mais également lorsque vous suivez d'autres procédures ou conseils de dépannage. Mise à jour: Cette réponse a été donnée à une version précédente de la question qui n'indiquait pas zsh comme shell utilisé.-> Remplacez zsh là où vous avez lu bash ci-dessus.
# complete:13: command not found: compdef ###### tags: `Tools` ## 問題: ``` complete:13: command not found: compdef ``` ## 解決: ``` autoload -Uz compinit compinit ``` Published on HackMD 7 Like1 Bookmark Subscribe 1
Sign in
Password Forgot password or By clicking below, you agree to our terms of service. Sign in via Facebook Sign in via Twitter Sign in via GitHub Sign in via Dropbox New to HackMD? Sign up Questions : Why cant zsh execute command compdef2022-09-26T06:45:12+00:00 2022-09-26T06:45:12+00:00 638 I have installed zsh and oh my zsh on Ubuntu anycodings_kubectl 18.04. I would like to use autocompletion anycodings_kubectl for kubectl. Therefore I have added source anycodings_kubectl <(kubectl completion zsh) to my ~/.zshrc anycodings_kubectl file. On execution of this script zsh gets the anycodings_kubectl following error:
The kubectl documentation states that when anycodings_kubectl one gets the error above, you should put the anycodings_kubectl following on top of the .zshrc file:
After doing this and restarting the anycodings_kubectl terminal, I get the same error. In a git-issue I found the following helped anycodings_kubectl people with a common issue:
zsh logs the following while running the anycodings_kubectl script:
Unfortunately this did not solve my problem. anycodings_kubectl What else can I do to fix my issue? Or even anycodings_kubectl still: what can I do to find out what is anycodings_kubectl causing it? Total Answers 8 32 Answers 1 : of Why cant zsh execute command compdefI fixed the error by using the following anycodings_kubectl code in .zshrc:
You may also do it using oh-my-zsh anycodings_kubectl plugin if you use oh-my-zsh. 0 2022-09-26T06:45:12+00:00 2022-09-26T06:45:12+00:00Answer Link mRahman 5 Answers 2 : of Why cant zsh execute command compdefI had the same issue and it was solved anycodings_kubectl updating nvm $ curl -o- anycodings_kubectl https://raw.githubusercontent.com/nvm-sh/nvm/v0.35.3/install.sh anycodings_kubectl | bash 0 2022-09-26T06:45:12+00:00 2022-09-26T06:45:12+00:00Answer Link joy 4 Answers 3 : of Why cant zsh execute command compdefFor my OSX 10.15.7 I did something anycodings_kubectl similar
Works like a charm! 0 2022-09-26T06:45:12+00:00 2022-09-26T06:45:12+00:00Answer Link miraj 4 Answers 4 : of Why cant zsh execute command compdefAfter trying lot of options and going anycodings_kubectl through diff treads. It worked for me anycodings_kubectl after running below command
This configures the ~/.zshrc and anycodings_kubectl initialize the compinit by adding these anycodings_kubectl 2 below lines:
and then run below sudo commands which anycodings_kubectl mentioned in link
at last restart the terminal. Hope this helps for someone. 0 2022-09-26T06:45:12+00:00 2022-09-26T06:45:12+00:00Answer Link jidam 1 Answers 5 : of Why cant zsh execute command compdefIn my case the issue was fixed after anycodings_kubectl re-installing oh-my-zsh:
0 2022-09-26T06:45:12+00:00 2022-09-26T06:45:12+00:00Answer Link joy 1 Answers 6 : of Why cant zsh execute command compdefI really tried every answer here, but anycodings_kubectl nothing worked. So, I tried this tutorial paying anycodings_kubectl attention to the last observation: "Note: Make sure you add this snippet anycodings_kubectl before any call to compdef else you will anycodings_kubectl still see the error" I had a complete call from Terraform anycodings_kubectl installation in my ~/.zshrc and anycodings_kubectl ~/.bash_profile files. https://thysmichels.com/2020/07/16/mac-solved-command-not-found-compdef/ 0 2022-09-26T06:45:12+00:00 2022-09-26T06:45:12+00:00Answer Link jidam 4 Answers 7 : of Why cant zsh execute command compdefFor me I had this line:
In my ~/.zshrc file. Which was trying to anycodings_kubectl source the plugin before it is loaded by anycodings_kubectl plugins=(git) Removing that line fixed it for me. If you have added the plugins and anycodings_kubectl everything works well, One of the anycodings_kubectl reasons is you may be trying to use the anycodings_kubectl plugin before it is loaded. As in my anycodings_kubectl case. 0 2022-09-26T06:45:12+00:00 2022-09-26T06:45:12+00:00Answer Link joy 1 Answers 8 : of Why cant zsh execute command compdefI encountered this after installing the anycodings_kubectl Angular CLI. Turns that Angular adds anycodings_kubectl something into your .zshrc file. If you recently installed Angular CLI, anycodings_kubectl open ~/.zshrc and remove the lines added anycodings_kubectl by Angular CLI. 0 2022-09-26T06:45:12+00:00 2022-09-26T06:45:12+00:00Answer Link raja |