.zshrc配置文件语法错误 [英] .zshrc config file syntax error

查看:87
本文介绍了.zshrc配置文件语法错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

.zshrc文件中某处出现语法错误,我似乎找不到它.

I'm getting a syntax error somewhere in my .zshrc file and I can't seem to find it.

我收到此错误消息:

.zshrc:49: bad assignment

这是我的.zshrc文件:

Here is my .zshrc file:

# Path to your oh-my-zsh configuration.
ZSH=$HOME/.oh-my-zsh

# Set name of the theme to load.
# Look in ~/.oh-my-zsh/themes/
# Optionally, if you set this to "random", it'll load a random theme each
# time that oh-my-zsh is loaded.
ZSH_THEME="robbyrussell"

# Example aliases
alias zshconfig="mate ~/.zshrc"
# alias ohmyzsh="mate ~/.oh-my-zsh"

# Set to this to use case-sensitive completion
# CASE_SENSITIVE="true"

# Uncomment this to disable bi-weekly auto-update checks
# DISABLE_AUTO_UPDATE="true"

# Uncomment to change how often before auto-updates occur? (in days)
# export UPDATE_ZSH_DAYS=13

# Uncomment following line if you want to disable colors in ls
# DISABLE_LS_COLORS="true"

# Uncomment following line if you want to disable autosetting terminal title.
# DISABLE_AUTO_TITLE="true"

# Uncomment following line if you want to disable command autocorrection
# DISABLE_CORRECTION="true"

# Uncomment following line if you want red dots to be displayed while waiting for completion
# COMPLETION_WAITING_DOTS="true"

# Uncomment following line if you want to disable marking untracked files under
# VCS as dirty. This makes repository status check for large repositories much,
# much faster.
# DISABLE_UNTRACKED_FILES_DIRTY="true"

# Which plugins would you like to load? (plugins can be found in ~/.oh-my-zsh/plugins/*)
# Custom plugins may be added to ~/.oh-my-zsh/custom/plugins/
# Example format: plugins=(rails git textmate ruby lighthouse)
plugins=(git)

source $ZSH/oh-my-zsh.sh

# Customize to your needs...

alias g2sites = "cd /Users/MYNAME/Dropbox/Development" #<< THIS IS THE LINE
alias g2work = "cd /Users/MYNAME/Dropbox/Development/Work"

questino中的这一行是倒数第二行.我的错误可能来自该行之前的语法,但我找不到它.

The line in questino is the second to last one above. It's possible that my error is coming from syntax before that line, but I can't find it.

您看到我在哪里弄错了吗?

Do you see where I made a mistake?

推荐答案

从别名命令中删除空格.正确的语法是

Remove the spaces from your alias command. The correct syntax is

eeyore% alias g2sites = "cd /Users/MYNAME/Dropbox/Development"
zsh: bad assignment
eeyore% alias g2sites="cd /Users/MYNAME/Dropbox/Development" 
eeyore% 

这篇关于.zshrc配置文件语法错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆