Skip to content

Instantly share code, notes, and snippets.

@stesla
Created November 1, 2011 02:45
Show Gist options
  • Save stesla/1329692 to your computer and use it in GitHub Desktop.
Save stesla/1329692 to your computer and use it in GitHub Desktop.
I Love Bash
#!/bin/bash
server=$1
if [ -z "$server" ]; then
echo "USAGE: ${0##*/} server"
exit 1
fi
while read first rest; do
for second in $rest; do
ssh -n $server "echo \"first=[${first}] second=[${second}]\""
done
done <<EOF
foo bar baz quux
fee fi fo fum
EOF
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment