Search
 
SCRIPT & CODE EXAMPLE
 

SHELL

run same command in different hosts

#!/bin/bash
USERNAME=someUser
HOSTS="host1 host2 host3"
SCRIPT="pwd; ls"
for HOSTNAME in ${HOSTS} ; do
    ssh -l ${USERNAME} ${HOSTNAME} "${SCRIPT}"
done
Comment

PREVIOUS NEXT
Code Example
Shell :: remove admin group ubuntu 
Shell :: how to install celluloid in kali 
Shell :: fdart string to uri 
Shell :: rsync only specific files but keep folders linux 
Shell :: filmora remove watermark free 
Shell :: Bash command to find the highest PID in your system 
Shell :: is unix an open source operating system 
Shell :: cookie clicker hack 
Shell :: how to install any software in arch linux with packman 
Shell :: initramfs ubuntu 20.04 
Shell :: whatsapp is installed but not installed error in android 
Shell :: pcmanfm resycle bin 
Shell :: URL (and Port) of Collabora Online-server 
Shell :: easter egg bash 
Shell :: can i setup 2fa for my ubuntu ssh 
Shell :: resume stopped job linux 
Shell :: is needed to run `file_system` for your system 
Shell :: how to take a screenshot on ubuntu 
Shell :: windows key not raising window in ubuntu 
Shell :: set 
Shell :: pip_install_packages.bat 
Shell :: printing from command line filters pipelines 
Shell :: httpie complex request 
Shell :: ubuntu 21.04 install gnome tweak tool 
Shell :: get jre path terminal macos 
Shell :: can we store the name of the current branch in a variable in bash 
Shell :: deleting compizconfig 
Shell :: NGINX setup for react plus django (rest framework) in same server 
Shell :: wget raw 
Shell :: git find commit by message 
ADD CONTENT
Topic
Content
Source link
Name
5+1 =