News for hackers. Stuff that matters.
Re:Homebrew now sends usage information to Google Analytics by tristor on Monday April 25, 2016 @06:07PM (#11567773)
Here's a quick and dirty way to opt out for BASH and ZSH users for easy copy/pasting.

BASH:

  cat <<EOF >> .bashrc
  # Opt out of Homebrew analytics
  export HOMEBREW_NO_ANALYTICS=1
  if [[ -e "$HOME/.homebrew_analytics_user_uuid" ]]; then
    rm -f "$HOME/.homebrew_analytics_user_uuid"
  fi
  EOF
ZSH:

  cat <<EOF >> .zshrc
  # Opt out of Homebrew analytics
  export HOMEBREW_NO_ANALYTICS=1
  if [[ -e "$HOME/.homebrew_analytics_user_uuid" ]]; then
    rm -f "$HOME/.homebrew_analytics_user_uuid"
  fi
  EOF

Cheers.
Re:Homebrew now sends usage information to Google Analytics by alainv on Monday April 25, 2016 @06:24PM (#11567886)
`rm -f` ignores nonexistent files so you could omit the `if` to be concise.
Re:Homebrew now sends usage information to Google Analytics by tristor on Monday April 25, 2016 @10:51PM (#11569106)
Good call. I was mainly using `-f` to suppress the prompt about deleting the file, but you're correct, it's unnecessary to have the if statement in this case.
Re:Homebrew now sends usage information to Google Analytics by hk__2 on Monday April 25, 2016 @06:24PM (#11567889)
You don’t need to remove that file; the whole point of this env variable is that it stops Homebrew from sending any data. It won’t even be created if that variable is set.
Re:Homebrew now sends usage information to Google Analytics by tristor on Monday April 25, 2016 @10:52PM (#11569109)
That's only true if the variable is set before the first instance when data would have been sent, otherwise the file will exist (as it did on my system).