Skip to content

Instantly share code, notes, and snippets.

@sloppycoder
Created December 18, 2023 08:50
Show Gist options
  • Select an option

  • Save sloppycoder/617f26b0a6df1594244469673ff9cfa4 to your computer and use it in GitHub Desktop.

Select an option

Save sloppycoder/617f26b0a6df1594244469673ff9cfa4 to your computer and use it in GitHub Desktop.
execute command on remote hosts
#!/bin/bash
CMD=$1
run() (
HOST=$1
ssh $HOST "$CMD"
)
for host in pie4 pie5 pie6 pie7 pie8 pie9
do
echo ==== $host ====
run pi@$host
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment