hush: implement $'str' bashism
function old new delta parse_dollar_squote - 441 +441 encode_then_expand_vararg 359 380 +21 parse_stream 2252 2271 +19 ------------------------------------------------------------------------------ (add/remove: 1/0 grow/shrink: 2/0 up/down: 481/0) Total: 481 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
This commit is contained in:
10
shell/hush_test/hush-quoting/dollar_squote_bash1.right
Normal file
10
shell/hush_test/hush-quoting/dollar_squote_bash1.right
Normal file
@@ -0,0 +1,10 @@
|
||||
a b
|
||||
$'a\tb'
|
||||
a
|
||||
b c
|
||||
def
|
||||
a'b c"d e\f
|
||||
a3b c3b e33f
|
||||
a\80b c08b
|
||||
a3b c30b
|
||||
x y
|
8
shell/hush_test/hush-quoting/dollar_squote_bash1.tests
Executable file
8
shell/hush_test/hush-quoting/dollar_squote_bash1.tests
Executable file
@@ -0,0 +1,8 @@
|
||||
echo $'a\tb'
|
||||
echo "$'a\tb'"
|
||||
echo $'a\nb' $'c\nd''ef'
|
||||
echo $'a\'b' $'c\"d' $'e\\f'
|
||||
echo $'a\63b' $'c\063b' $'e\0633f'
|
||||
echo $'a\80b' $'c\608b'
|
||||
echo $'a\x33b' $'c\x330b'
|
||||
echo $'x\x9y'
|
6
shell/hush_test/hush-quoting/dollar_squote_bash2.right
Normal file
6
shell/hush_test/hush-quoting/dollar_squote_bash2.right
Normal file
@@ -0,0 +1,6 @@
|
||||
strstrstrstrstrstrstrstrstrstrstrstrstrstrstrstrstr
|
||||
strstrstrstrstrstrstrstrstrstrstrstrstrstrstrstrstr
|
||||
80:\<5C>
|
||||
81:\<5C>
|
||||
82:\<5C>
|
||||
Done:0
|
10
shell/hush_test/hush-quoting/dollar_squote_bash2.tests
Executable file
10
shell/hush_test/hush-quoting/dollar_squote_bash2.tests
Executable file
@@ -0,0 +1,10 @@
|
||||
# Embedded NULs
|
||||
echo $'str\x00'strstrstrstrstrstrstrstrstrstrstrstrstrstrstrstr
|
||||
echo $'str\000'strstrstrstrstrstrstrstrstrstrstrstrstrstrstrstr
|
||||
|
||||
# The chars after '\' are hex 0x80,81,82...
|
||||
echo 80:$'\<5C>'
|
||||
echo 81:$'\<5C>'
|
||||
echo 82:$'\<5C>'
|
||||
|
||||
echo Done:$?
|
1
shell/hush_test/hush-vars/var_bash7.right
Normal file
1
shell/hush_test/hush-vars/var_bash7.right
Normal file
@@ -0,0 +1 @@
|
||||
B
|
1
shell/hush_test/hush-vars/var_bash7.tests
Executable file
1
shell/hush_test/hush-vars/var_bash7.tests
Executable file
@@ -0,0 +1 @@
|
||||
x=AB; echo "${x#$'\x41'}"
|
Reference in New Issue
Block a user