Cannot sudo a custom function in a zsh script byAuthor •October 18, 2023 If you're unable to run a custom function with `sudo` in a Zsh script, it's likely due to how Zsh interacts with `sudo` and function scoping. To execute a custom function with `sudo` in a Zsh script, you can use the `sudo` command to run the …