So, I would like to keep bash as the default shell for root.
But, I would prefer to use zsh, my shell, when I run sudo commands, and that sudo executes also the .zshrc in /root.
For testing purposes, I have created an alias in my /root/.zshrc and ~/.zshrc :
alias test1='echo "Test OK"'
Now, when I run sudo su enter zsh enter test1 enter
I got the expected result : Test OK
However, all of these commands result in : test1: command not found
sudo test1
sudo su -c 'zsh -c test1'
sudo -E zsh -c 'test1'
sudo ZDOTDIR=/root/.zshrc test1
sudo ZDOTDIR=/root/.zshrc zsh -c 'test1'
sudo ZDOTDIR=/root/.zshrc zsh -c 'source /root/.zshrc && test1'
I found this question on askubuntu, but I think this is more related to this one on Unix & Linux.
However, none of these posts help me.
What I want to achieve in final is to create a simple alias that could replace sudo when I want to use zsh with its /root/.zshrc file, and prefix the command I want to run.
Any hints ?