I am writing a simple code for gcloud. In my script, I want to get a list of all projects on an account and for each of them call a gcloud command that requires user input which I want to emulate in my bash script.
projects_list=$(gcloud projects list)
for n in $projects_list
do
gcloud projects dosomething $n
done
Every time I call gcloud projects dosomething, it asks "Do you want to continue (Y/n)?" and waits for an input from user. How do I automate this and make script emulate pressing Y?