I am stucking on kubernetes autocompletion on my macbook for a while. Whatever I try with the document (https://kubernetes.io/docs/tasks/tools/install-kubectl/#enabling-shell-autocompletion) it does not work
# install fish
$ brew install fish
# set kubectl completion for fish shell
$ mkdir -p ~/.config/fish/completions
$ cd ~/.config/fish
$ git clone https://github.com/evanlucas/fish-kubectl-completions
$ ln -s ../fish-kubectl-completions/completions/kubectl.fish completions/
# if you have kubernetes cluster, skip this part
$ brew install kink
$ kind create cluster
# Now you can get autocompletion directly
$ fish
Welcome to fish, the friendly interactive shell
Type `help` for instructions on how to use fish
bill@192-168-1-107 ~/.kube> kubectl get node
NAME STATUS ROLES AGE VERSION
kind-control-plane Ready master 4m31s v1.17.0
kind-worker Ready <none> 3m57s v1.17.0
kind-worker2 Ready <none> 3m57s v1.17.0
kind-worker3 Ready <none> 3m57s v1.17.0
bill@192-168-1-107 ~/.kube> kubectl describe pod/jenkins-1591700084-6b4ff48648-h57pq
enjoy it. It has more features than you are thinking.
go through this repo: https://github.com/sjl/z-fish
So you have problem with $ in command, such as
export files=$(ls)
You have to replace with
export files=(ls)
Powerful History Mechanism
Modern shells save previous commands in a command history. You can view earlier commands by using the up and down arrows. Fish extends this concept by integrating the history search functionality. To search the history, simply type in the search string, and press the up arrow. By using the up and down arrow, you can search for older and newer matches. The fish history automatically removes duplicate matches and the matching substring is highlighted. These features make searching and reusing previous commands much faster.
I can't run below script easily in fish now,
ls |while read line
do
echo $line
done
You have to adjust to
ls |while read line
echo $line
end
https://lwn.net/Articles/136232/
https://github.com/jorgebucaran/fish-cookbook#how-do-i-read-from-a-file-in-fish