plz help with this script,
I wish to ssh this command to several hosts:
ls -alst "dir_with_spaces"
This script is close but I need DOUBLE-quotes around the remote command s
#! /bin/bash
PARAMS_FOR_LS=(-alst "dir with spaces")
# get directory of local system
ls "${PARAMS_FOR_LS[@]}"
# get directory of remote systems
#do search 'x' for a hostname; get host1
ssh host1 ls "${PARAMS_FOR_LS[@]}"
#do search 'y' for a hostname; get host2
ssh host2 ls "${PARAMS_FOR_LS[@]}"
#do search 'z' for a hostname; get host3
ssh host3 ls "${PARAMS_FOR_LS[@]}"
I have tried several variations of eval and echo.
plz help