Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What does this mean >> ~/.zshrc?

Tags:

zsh

rbenv

Can someone clarify me the difference between these two lines?

export PATH=./bin:~/.rbenv/bin:$PATH

and

export PATH=./bin:~/.rbenv/bin:$PATH >> ~/.zshrc

What is this doing?

>> ~/.zshrc

This is written in a .zshrc file. Which language is used there? Where I can learn the syntax? The export, eval etc.

like image 234
AlbertMunichMar Avatar asked Sep 21 '17 09:09

AlbertMunichMar


2 Answers

it means:

  • >> is append to
  • ~ is file located in current user's home directory
  • .zshrc is file called .zshrc
like image 165
diginoise Avatar answered Nov 24 '22 08:11

diginoise


Usually this is used outside of the .zshrc file (or .bashrc file or similar) to add something to it, for example you would normally write something like the following:

echo 'export PATH=./bin:~/.rbenv/bin:$PATH' >> ~/.zshrc

This will write the export setting within the quotes to your .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 .zshrc file every time you log in. The export command outputs nothing, so this extra part will essentially do nothing, and should probably be removed so you are left with just the first line.

like image 45
Sean Burton Avatar answered Nov 24 '22 10:11

Sean Burton