command not found: __start_kubectl - kubernetes

I installed kubectl and tried enable shell autocompletion for zsh.
When I'm using kubectl autocompletion works fine. Howewer when I'm trying use autocompletion with alias k then shell return me
k g...(eval):1: command not found: __start_kubectl  8:45
(eval):1: command not found: __start_kubectl
(eval):1: command not found: __start_kubectl
In my .zshrc file I have:
source <(kubectl completion zsh)
alias k=kubectl
compdef __start_kubectl k

add the following to the beginning of your ~/.zshrc file:
autoload -Uz compinit
compinit
then restart your terminal.

Can you try this one:
compdef _kubectl k

Related

How to resolve .zshenv. command not found pyenv?

I have pyenv installed and my .zshenv looks like the following :
export PYENV_ROOT="$HOME"/.pyenv
export PATH="$PYENV_ROOT"/bin:"$PATH"
if command -v pyenv 1>/dev/null 2>&1; then
eval "$(pyenv init -)"
fi
eval "$(pyenv virtualenv-init -)"
When I open a new terminal it gives me the following error:
.zshenv. command not found: : pyenv
The fix in the github issue link didn't work for me.
The problem was that pyenv wasn't on the path at the time of running pyenv init.
I add export PATH=/usr/local/bin:"$PATH" to my .zshenv before calling pyenv init.

I removed Pyenv in MAC. How to initialize environment variable?

I have some problems about pyenv in my MAC so I removed it.
After that I open the terminal, always -bash: pyenv: command not found message appear.
I guess this is about environment problem.
How can I solve this?
Last login: Wed Jun 19 22:15:19 on ttys000
-bash: pyenv: command not found
-bash: pyenv: command not found
-bash: pyenv: command not found
-bash: pyenv: command not found
-bash: pyenv: command not found
-bash: pyenv: command not found
-bash: pyenv: command not found
ShinTaeyongui-iMac:~ shintaeyong$
A configuration file of your shell (bash) still contains a reference to the pyenv command. Depending on how you installed pyenv, this configuration file could be ~/.bashrc or ~/.bash_profile (or both).
The lines you are looking for are probably either (if installed via pipenv-installer):
export PATH="$HOME/.pyenv/bin:$PATH"
eval "$(pyenv init -)"
eval "$(pyenv virtualenv-init -)"
Or (if installed via the manual instructions):
export PYENV_ROOT="$HOME/.pyenv"
export PATH="$PYENV_ROOT/bin:$PATH"
eval "$(pyenv init -)"
You should be able to safely remove all lines containing pipenv. If you want to be safe, you can disable the lines instead of removing them by adding an # in front of them.

How to enable kubernetes commands autocomplete

I'm tired of writing all kubectl and kubeadm commands by hand. Is there any way of enabling autocomplete on these commands?
Bash Solution
# Execute these commands
$ echo "source <(kubectl completion bash)" >> ~/.bashrc
$ echo "source <(kubeadm completion bash)" >> ~/.bashrc
# Reload bash without logging out
$ source ~/.bashrc

xgettext: No such file or directory

I'm using this command line:
xgettext -kT._ -kT._n:1,2 -kT._p:1c,2 -kT._pn:1c,2,3
-LC# --omit-header --from-code=UTF-8 -o messages.pot
-c -n -p PO ./TransClassOne.cs
Nevertheless, I'm getting this message from xgettext:
xgettext.exe: error while opening "._" for reading: No such file or directory
Any ideas?
Using MacOS:
Install gettext tool
If already installed, you might want to reinstall - brew reinstall gettext
If using some bash profile (oh-my-zsh e.g.), export gettext and update it:
nano ~/.zshrc
at the end of file add export PATH="/usr/local/opt/gettext/bin:$PATH" and save it
update profile with . ~/.zshrc ; pay attention to not forget the dot before zshrc
restart your terminal (optional)
Run your command again.

Cant access Coda application from command-line

I am having trouble accessing Coda from command-line. I installed the "command-line coda" plug-in, verified that my installation is in the correct location, yet I still can seem to access Coda. Coda sits in my "Applications" folder which is the default location for the plug-in.
Anyone have have this problem? Any tips? On the their site it is recommended that you change the path.
export CODEPATH=/Applications/Coda.app
So I included the above line in my .bash_profile which did not help.
$ Coda -v
-bash: Coda: command not found
Thanks for any direction you can provide.
The default way to open an application on a Mac is to use open -a AppName so you should be able to change your bash profile to use that:
$ open -a Coda
I've created a bash script (as opposed to using the plugin) that Gregory Tomlinson originally posted about (it looks like he's since taken it down but it looks like the following).
Create a new file in /bin called coda:
$ cd /bin
$ sudo touch coda
$ vim coda
Hit an i to enter insert mode. Then include the following code:
#! /bin/bash
if [ "$1" = "" ]; then
echo "Please specify a file to open or create"
exit 0
else
for ARG in $*
do
touch -a $ARG && open -a Coda $ARG
done
exit 0
fi
Save and quit (hit the esc to exit insert mode then type :w !sudo tee % >/dev/null followed by the return key, press L for load when prompted, then type :q to quit). Then give that file execute permissions:
$ chmod u+x coda
Start a new Terminal window and you should be able to use:
$ coda filename.foo
Or just:
$ coda
For some strange reason, my paid registered Coda 2 app just wouldn't open for me this morning. I found this terminal command that worked for me:
open -a Coda\ 2
You can also put the following in your ~/.bash_profile file:
alias coda='open -a "Coda 2"'
I had a similar problem. After installing the plug-in, I still couldn't launch coda from the command line. I took a closer look at /user/local/bin and somehow the permissions had gotten reset so I didn't have execute permissions for /user/local/bin.
I updated my permissions with:
sudo chmod o=rx,g=rx /usr/local/bin
This solved my problem. However, Coda won't launch if the specified file does not exist, which makes it hard to create a file from the command line.