After a fresh install of Arch Linux, I went ahead and made a shell program (.sh) which has these lines:
echo Installing yay in this machine
git clone https://aur.archlinux.org/yay.git
sudo makepkg -si
But it shows an error stating like this:
ERROR: Running makepkg as...