mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
SSH shell shim: Don't use $() for optimal support
Some shells don't support the `$()` syntax, so use the backticks instead.
This commit is contained in:
parent
38ed46a61a
commit
47cf00d88e
1 changed files with 3 additions and 3 deletions
|
@ -157,17 +157,17 @@ do
|
|||
py_cmd_path=`"$py_cmd" -c \
|
||||
'from __future__ import print_function;
|
||||
import sys; print(sys.executable);'`
|
||||
cmdpath=$(command -v $py_cmd 2>/dev/null || which $py_cmd 2>/dev/null)
|
||||
cmdpath=`command -v $py_cmd 2>/dev/null || which $py_cmd 2>/dev/null`
|
||||
if file $cmdpath | grep "shell script" > /dev/null
|
||||
then
|
||||
ex_vars="'PATH', 'LD_LIBRARY_PATH', 'MANPATH', \
|
||||
'XDG_DATA_DIRS', 'PKG_CONFIG_PATH'"
|
||||
export $($py_cmd -c \
|
||||
export `$py_cmd -c \
|
||||
"from __future__ import print_function;
|
||||
import sys;
|
||||
import os;
|
||||
map(sys.stdout.write, ['{{{{0}}}}={{{{1}}}} ' \
|
||||
.format(x, os.environ[x]) for x in [$ex_vars]])")
|
||||
.format(x, os.environ[x]) for x in [$ex_vars]])"`
|
||||
exec $SUDO PATH=$PATH LD_LIBRARY_PATH=$LD_LIBRARY_PATH \
|
||||
MANPATH=$MANPATH XDG_DATA_DIRS=$XDG_DATA_DIRS \
|
||||
PKG_CONFIG_PATH=$PKG_CONFIG_PATH \
|
||||
|
|
Loading…
Add table
Reference in a new issue