I want a script to execute the command:
ls -alst "dir with spaces"
The script looks like this :
#! /bin/bash
PARAMS_FOR_LS="-alst \"dir with spaces\""
echo $PARAMS_FOR_LS
ls $PARAMS_FOR_LS
when I execute the script:
bash -x script.sh
I get:
+ PARAMS_FOR_LS='-alst "dir with space
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