Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

.zshrc config file syntax error

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

I'm getting this error message:

.zshrc:49: bad assignment

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"

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?

like image 399
Joshua Soileau Avatar asked Nov 12 '13 02:11

Joshua Soileau


People also ask

What is .zshrc file in Linux?

Zshrc is a configuration file that contains the commands that run the zsh shell, just like the . bashrc file that contains commands for the bash shell. It contains scripts that run whenever an interactive zsh session is launched. In Linux, the file is stored in the home/user directory as a hidden file.

How do I create a Zshrc file in Linux?

You can run the helper script zsh-newuser-install from the prompt, and it will walk you through the process to create an initial . zshrc in your home directory. Show activity on this post. It should list all the paths where the corresponding file exists.

Where is my .zshrc file Linux?

zshrc file located in your home directory. It's a hidden file, so you might not see it in your home directory, but you can view it by running open ~/. zshrc from the terminal.

What is Zshrc file used for?

zshrc file so that, assuming you are using ZSH as your shell, it will get executed when you log in. The fact that the line actually in your . zshrc file contains this would appear to be an error. In this case it will write the output from the export command to the .


Video Answer


1 Answers

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% 
like image 81
Elliott Frisch Avatar answered Oct 18 '22 09:10

Elliott Frisch