0

Here is the entirety of my .zshrc.

alias ll='ls -l'
export HOME='/Users/rcorty/Dropbox'

This file is at /Users/myname/.zshrc.

When I start iTerm2, I check whether the home directory was reset by entering ls ~ and I recognize the files in my Dropbox -- success! Then I enter ll and I am met with zsh: command not found: ll.

Weird. Then I run source /Users/myname/.zshrc. Now I do the same two checks and they both succeed (HOME is Dropbox and ll is ls -l.

I'm rather novice with shells in general and zsh in particular. From my reading of the zsh documentation, it seems like .zshrc should essentially be "sourced" each time I start a shell.

Where have I gone wrong?

5
  • Here's one of the things that break when you change your HOME environment variable. ZSH is looking for .zshrc in $HOME. – Allan May 12 '20 at 14:34
  • I thought about this...but since I have the alias before the change in HOME...it should still work? Or should I put only the change in HOME in myname/.zshrc and make another .zshrc in Dropbox? – rcorty May 12 '20 at 14:37
  • See: apple.stackexchange.com/a/388623/119271 – Allan May 12 '20 at 14:43
  • @Allan, thank you for sharing that link -- I had a look through the page and nothing jumped out at me as super relevant to this question. Were you providing background information? Or is there something in particular you wanted to draw attention to? – rcorty May 12 '20 at 14:46
  • background info and the fact that a system wide files get loaded and sets environment variables. – Allan May 12 '20 at 14:47
1

Okay, it's working now. /Users/myname/.zshrc is:

export HOME='/Users/rcorty/Dropbox'

and /Users/myname/Dropbox/.zshrc is:

alias ll='ls -l'

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .