How to update a list of applications with brew?

Viewed 19160

I want to create a script to force update brew applications that are outdated.

I tried something like that, but it's not working:

var=$(brew cask outdated); for f in $var; do "brew upgrade $var --force"; done

I am a beginner in bash, I think what I'm searching is easy, but i need help.

2 Answers

In 2020

axiac's response is basically perfect. Just to note that brew cask upgrade is disabled in the latest versions of Homebrew, so you should use brew upgrade --cask instead.

Related