su using here document - by user32206 file: test.sh who su superuser <<BELUGA mysuperpassword BELUGA who $ ./test.sh just waits for input. What am I doing wrong? Is there a way to automate this? Read the article