Trying to do imbricated escape and that doesn't work obviously.
My parameter with space is customer and its value is NAME WITH SPACE.
chroot /sites/FOLDER1 /bin/su FOLDER2 -c "/data/batch/myScript.sh -v -g -action params -customer NAME WITH SPACE"
I'm getting:
Error : Unknown parameter WITH
I read a few threads on the subjects but can't make out a solution : https://superuser.com/questions/360966/how-do-i-use-a-bash-variable-string-containing-quotes-in-a-command http://mywiki.wooledge.org/BashFAQ/050
Tried with single and double quote, with storing the param in a variable etc but no dice.
If I use
chroot /sites/FOLDER1 /bin/su FOLDER2 -c '/data/batch/myScript.sh -v -g -action params -customer 'NAME WITH SPACE''
It works a little better as I do not get the unknown parameter but it only takes NAME as parameter and ignore what is after the space