# Ubuntu – single line command to do su

I can do an su with su <username> and it asks for my password. Is there a password parameter for su such that i wont be prompted for a password?

e.g. su <username> -p <password>

If you want to write a script that runs as a different user something like this works, though it dows output the word "password" without a newline to standard out

su - username <<!

su - fred <<! >/dev/null 2>&1