, bash script tarball stdin.
1. base64-encoded tarball heredoc
bash script, tarball heredoc:
base64 -d <<'EOF_TAR' | tar -zx
<base64_tarball>
EOF_TAR
:
ssh $HOST bash -s < <(
cat <<'EOF'
cd /tmp
base64 -d <<'EOF_TAR' | tar -zx
EOF
tar -cz ./archive | base64
cat <<'EOF'
EOF_TAR
./archive/some_script.sh
rm -r archive
EOF
)
tar tarball , .
2. script
bash script stdin, tarball. bash tar, tar- stdin:
ssh $HOST bash -s < <(
cat <<'EOF'
function main() {
cd /tmp
tar -zx
./archive/some_script.sh
rm -r archive
}
main
EOF
tar -cz ./archive
)
, tar tarball .
main, ? bash script, tar? , bash script, , tar tarfile, bash script. , main bash script tar.