Re: script with ssh and filenames with spaces

2013-07-17 Thread Greg Wooledge
On Wed, Jul 17, 2013 at 08:42:17PM +, gscant...@comcast.net wrote: > I wish to ssh this command to several hosts: > ls -alst "dir_with_spaces" for host in "${hosts[@]}"; do ssh "$host" bash <<-'EOF' ls -alst "your directory" EOF done The - in front of the here document's d

script with ssh and filenames with spaces

2013-07-17 Thread gscantlen
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[@]}" # g