#!/bin/bash HOST=$1 ssh root@$HOST 'bash -s' <<'ENDSSH' # commands to run on remote host echo Installing httpd yum install -y httpd echo Yum exited with status $? ENDSSH