Use echo c1oudc0w | sudo -p "" -S -- sed ... to avoid the prompt and user interaction