1

What am I doing wrong here?

% echo "export HOMEBREW_GITHUB_API_TOKEN=XXXX">> ~/.zshrc;
% source ~.zshrc;
zsh: no such user or named directory: .zshrc
4
  • 3
    a missing / between ~ and .zshrc maybe ?
    – Archemar
    Apr 29, 2022 at 9:49
  • That gives me /Users/.zshrc:2: no such file or directory: token /Users/.zshrc:8: parse error near `\n'
    – User8889
    Apr 29, 2022 at 9:52
  • By changing the question after getting answers, this is become a little less useful.
    – steve
    Apr 29, 2022 at 10:18
  • Umm, yeah, I don't think you'd get that error with source ~/.zshrc. It matches source ~.zshrc perfectly though, so I wonder what the point of that edit was?
    – ilkkachu
    Apr 29, 2022 at 10:27

1 Answer 1

4

You're missing /

Your command source ~.zshrc tries to lookup the home directory for a user called .zshrc. The source command would presumably attempt to execute that user's home directory - and fail.

What you probably meant was this, which looks up your home directory with ~ and then source can execute the commands in a file .zshrc in there.

 source ~/.zshrc
8
  • correcting that gives me /Users/zshrc:2: no such file or directory: token /Users/.zshrc:8: parse error near `\n'
    – User8889
    Apr 29, 2022 at 9:54
  • 2
    You've broken your $HOME variable Apr 29, 2022 at 9:56
  • I am very newb at this can you please guide me how to fix it?
    – User8889
    Apr 29, 2022 at 9:59
  • 1
    Open a new terminal session on your Mac. Unexpected error messages? Apr 29, 2022 at 10:05
  • still the same error source ~/.zshrc; /Users/.../.zshrc:2: no such file or directory: token /Users/.../.zshrc:8: parse error near `\n'
    – User8889
    Apr 29, 2022 at 10:11

You must log in to answer this question.

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