Return to Snippet

Revision: 46321
at May 17, 2011 17:21 by nohn


Initial Code
for server in one two three; do
ssh $server sudo bash -c "'cat >> /some/file << EOF
Some Content
EOF'"
done

Initial URL

                                

Initial Description
Ever wanted to execute remote commands with sudo while redirecting output to a file that doesn't belong to the user you login with? Combine single quotes with double quotes!

Initial Title
Remote sudo with redirect

Initial Tags
ssh

Initial Language
Bash