Skip to content
Snippets Groups Projects
Commit 1942a736 authored by Ger van Diepen's avatar Ger van Diepen
Browse files

Bug 1651: pattern characters needed to be changed to avoid expansion by cexec

parent 25fd4e27
No related branches found
No related tags found
No related merge requests found
......@@ -101,6 +101,14 @@ commandnew=`echo "$command" | sed \
-e 's%"%:DQUOTE:%g' \
-e "s%'%:SQUOTE:%g" \
-e 's%\\$%:DOLLAR:%g'`
# Furthermore it expands the nameglob, so change that as well.
nameglobnew=`echo "$nameglob" | sed \
-e 's%\*%:ASTERISK:%g' \
-e 's%\?%:QUESTIONMARK:%g' \
-e 's%\[%:LBRACKET:%g' \
-e 's%\]%:RBRACKET:%g' \
-e 's%{%:LBRACE:%g' \
-e 's%}%:RBRACE:%g'`
cexec $cluster cexecms-part -e "$envfile" "'$commandnew'" "$nameglob" "$@"
cexec $cluster cexecms-part -e "$envfile" "'$commandnew'" "$nameglobnew" "$@"
rm -f "$envfile"
......@@ -46,8 +46,15 @@ if test "$envfile" != ""; then
. $envfile
fi
# Find all matching files (first substitute # by [0-9]).
nameg=`echo "$nameglob" | sed -e 's%#%[0-9]%g'`
# Find all matching files (first substitute # by [0-9] and substitute special characters back).
nameg=`echo "$nameglob" | sed \
-e 's%#%[0-9]%g' \
-e 's%:ASTERISK:%*%g' \
-e 's%:QUESTIONMARK:%?%g' \
-e 's%:LBRACKET:%[%g' \
-e 's%:RBRACKET:%]%g' \
-e 's%:LBRACE:%{%g' \
-e 's%:RBRACE:%}%g'`
names=`ls -d $nameg 2>&1`
if test $? != 0; then
echo "No file matching $nameg found"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment