Created
November 1, 2011 02:45
-
-
Save stesla/1329692 to your computer and use it in GitHub Desktop.
I Love Bash
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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