diff options
author | P. J. McDermott <pj@pehjota.net> | 2016-02-21 02:53:36 (EST) |
---|---|---|
committer | P. J. McDermott <pj@pehjota.net> | 2016-02-21 02:54:35 (EST) |
commit | 7d41cd8c37232fb86e75fec705b3fda2b5ecb562 (patch) | |
tree | 29576238b5b239ec142ccd59ad0c08a93dd2ac16 | |
parent | effd399b41f6a1b8b0f515ec3901ff60fddfeced (diff) | |
download | eggshell-7d41cd8c37232fb86e75fec705b3fda2b5ecb562.zip eggshell-7d41cd8c37232fb86e75fec705b3fda2b5ecb562.tar.gz eggshell-7d41cd8c37232fb86e75fec705b3fda2b5ecb562.tar.bz2 |
Remove quotes in here-document delimiters
-rw-r--r-- | parsing/lexer.sh | 3 | ||||
-rw-r--r-- | parsing/parse.sh | 4 |
2 files changed, 4 insertions, 3 deletions
diff --git a/parsing/lexer.sh b/parsing/lexer.sh index d559274..aa72ec1 100644 --- a/parsing/lexer.sh +++ b/parsing/lexer.sh @@ -195,7 +195,8 @@ next_here() here="${here_queue%%${RS}*}" here_strip_tabs="${here%%${US}*}" here_end="${here%${US}*}" - here_end="${here_end#*${US}}" + here_end="$(printf '%s' "${here_end#*${US}}" | \ + sed 's/\\//g; s/"//g; s/'\''//g;')" # Stupid Vim: ')" here_escaped="${here##*${US}}" here_queue="${here_queue#*${RS}}" here_awaiting_word=false diff --git a/parsing/parse.sh b/parsing/parse.sh index 63b2cba..ddcdd97 100644 --- a/parsing/parse.sh +++ b/parsing/parse.sh @@ -627,7 +627,7 @@ try() } #try '"foo bar" && $baz || qux' '${quux%uux quuux' -try '"foo bar" && $baz || qux' '${quux%uux } quuux' +#try '"foo bar" && $baz || qux' '${quux%uux } quuux' #try 'foo ${bar}' #try 'foo ${#bar}' #try 'foo ${bar#baz}' @@ -659,5 +659,5 @@ try '"foo bar" && $baz || qux' '${quux%uux } quuux' #try 'foo <<EOF' 'bar' 'EOF' #try 'foo <<-EOF' "${HT}bar" "${HT}EOF" #try 'foo <<EOF' '$(bar)' 'EOF' -#try 'foo <<E"O"F' '$(bar)' 'E"O"F' # BUG +try 'foo <<E"O"F' '$(bar)' 'EOF' #try 'foo <<EOF1; bar <<EOF2' 'baz' 'EOF1' 'qux' 'EOF2' |