This means the following characters will be processed as literals rather than escaped in ways that don't work in some circumstances:
single quote '
double quote "
backslash \
As literals, whether in $VARNAME'$VARNAME'"$VARNAME", they will be literals in there too (as in not processed as their scripting/shell varients).
The issue before was that when setting the variable VARNAME: "'test'" resulted in export VARNAME="\'test\'" from addslashes adding \ literals, making the literal value \'test\', which instead will no longer be the case, making the literal value 'test'.
It was fine before for " and \ since they needed escaping to be literals within "...".
A side-effect of this change is also that $ will be processed literal, whereas before it was possible to do:
command('...'):
env:
VAR: "$USER"
exec:
#!bash
echo "$VAR" // before: prints expansion of `$USER`, after: prints `$USER`
Note:
proc_open supports an env parameter, but needs explicit adding of previous env as well if used
bash scripts can receive positional arguments, so use them and map them back to their bash variable name
arguments are not exposed as an option anywhere yet, other than through expressions in env
proc_open supports auto-escaping of array commands
proc_open supports cwd setting as well, but I'm avoiding it due to not supporting relative path unlike the cd in the script
This means the following characters will be processed as literals rather than escaped in ways that don't work in some circumstances:
'
"
\
As literals, whether in
$VARNAME
'$VARNAME'
"$VARNAME"
, they will be literals in there too (as in not processed as their scripting/shell varients).The issue before was that when setting the variable
VARNAME: "'test'"
resulted inexport VARNAME="\'test\'"
from addslashes adding\
literals, making the literal value\'test\'
, which instead will no longer be the case, making the literal value'test'
.It was fine before for
"
and\
since they needed escaping to be literals within"..."
.A side-effect of this change is also that
$
will be processed literal, whereas before it was possible to do:Note: