zsh

brew: /usr/bin occurs before /usr/local/bin

ⅰ亾dé卋堺 提交于 2019-12-11 03:05:30
问题 As subject says, running brew doctor responds with following warnings: Warning: /usr/bin occurs before /usr/local/bin This means that system-provided programs will be used instead of those provided by Homebrew. The following tools exist at both paths: ... Warning: Homebrew's bin was not found in your PATH. .... Warning: Homebrew's sbin was not found in your PATH but you have installed formulae that put executables in /usr/local/sbin. However, when I echo PATH, it shows /usr/local/bin as being

Zsh doesn't autocomplete correctly my ssh command

霸气de小男生 提交于 2019-12-11 01:27:50
问题 I have some problem with ssh autocompletion. I would like for my zsh to autcomplete on my .ssh/config file but until now it is only doing it with the /etc/hosts files. I've found how to not use the hosts file by adding this configuration zstyle ':completion:*:ssh:*' hosts off But I cannot succeed in making zsh look into the .ssh/config files I've tried this with little hope, but it didn't work zstyle ':completion:*:ssh:*' config on Here is my .zshrc file # If you come from bash you might have

Getting a Python Virtual Environment, Fabric and Sudo to Work Together

烂漫一生 提交于 2019-12-10 21:32:54
问题 Steps to reproduce: In a linux environment, create a folder on your desktop called 'fab' FYI, I'm using zsh cd to ~/Desktop/fab Run this fabfile.py made in your ./fab dir by issuing fab init : #!/usr/bin/env python #set up ssh to remote server import sys, os, fileinput from fabric.api import * def init(): local('mkdir ./virtualenv') local('cd ./virtualenv && virtualenv --no-site-packages venv') local('chown -R user:user ./virtualenv/') local('chmod 770 -R ./virtualenv/') venv = 'source .

Vim/Vundle broken after reverting back to bash from zsh

只谈情不闲聊 提交于 2019-12-10 20:14:54
问题 This is the error message I get when trying to BundleInstall: Shell can't be executed /bin/zsh Error while executing "function vundle#installer#new..<SNR>37_process..vundle#installer#run..vundle#installer#install..<SNR>37_sync..<SNR>37_system": Line 1: E484: Can't open file /tmp/vfHFBSJ/8 Error while executing "function vundle#installer#new..<SNR>37_process": Zeile 13: E121: Undefined variable: g:vundle_last_status E15: Invalid expression: 'error' == g:vundle_last_status Zeile 17: E121:

OS X Terminal hangs installing vNext KVM after running “source kvm.sh”

。_饼干妹妹 提交于 2019-12-10 17:18:55
问题 I'm trying to install vNext on my Macbook but when I run source kvm.sh the terminal just hangs. My setup: OSX 10.9.5 (Mavericks) Mono 3.10.0 My problem: I followed the instructions for installing vNext on OS X from the GitHub repo: https://github.com/aspnet/Home Essentially: brew tap aspnet/k brew install kvm source kvm.sh Everything seems to go fine until the step where I run source kvm.sh , which hangs the terminal with a message " [Process completed] ". Adding source kvm.sh to ~/.zshrc

bash, zsh : declare [*] (oh my)

时光总嘲笑我的痴心妄想 提交于 2019-12-10 17:10:22
问题 I'm working with a bash script that has the following syntax $ declare -a THIS[*] This seems to be illegal in zsh (I get a "no matches found: THIS[*]" error). Can anyone help me translate this to zsh? Also - what does the [*] syntax mean? (I know we're declaring an array, but why the [*]?) update To provide an example of where the code is used, and explain how it is valid - I've copied a few lines from Eric Engstrom's post on password free ssh declare -a SSSHA_KEYS[*] # --- PARSE ARGS --- #

zsh equivalent of bash ${!name*} or ${!name@}

五迷三道 提交于 2019-12-10 16:44:24
问题 In bash , there is a parameter expansion to generate the names of variables matching a given prefix. For example: $ foo1=a foo2=b four=4 $ echo "${!foo@}" foo1 foo2 Is there an equivalent in zsh ? I know the (P) parameter expansion flag is the equivalent of the similar bash indirection expansion ${!foo} : # bash $ foo=bar bar=3 $ echo ${!foo} 3 # zsh % foo=bar bar=3 % echo ${(P)foo} 3 but as far as I can tell, (P) does not also handle prefix matching. % echo "${(P}foo@}" zsh: bad substitution

ZSH: Call in-built function from zsh function that uses the same name

别等时光非礼了梦想. 提交于 2019-12-10 16:34:41
问题 I use zsh and would like to slightly extend the in-built cd function. I'd like that when I call cd , it changes directly and then lists the content of the directory. function cd() { cd $1 ls . } I'd have expected this code to work, but as it turns out, the call to cd refers to the function definition, resulting in an infinite loop. Is there a work-around to solve this problem, apart from choosing a different name for my function? UPDATE Strangely enough, this worked function cd() { `echo $1`

How can I intermittently show my history command number in my shell prompt?

好久不见. 提交于 2019-12-10 16:13:59
问题 How can I intermittently show my history command number in my shell prompt? For instance, rather than showing it in EVERY prompt, just do it every 7 times. (I'm using zsh, but I think bash should be virtually identical.) The problem I encounter is that %h is not evaluated until it's in the PROMPT variable, and $HISTCMD is always evaluated as 0 for some reason. So putting a function like this into my prompt fails because $HISTCMD is always 0: prompt_history() { CYCLE=$(( $HISTCMD % 7 )) if [[