hush: add var4.tests, var5.tests

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
This commit is contained in:
Denys Vlasenko 2016-10-02 21:13:13 +02:00
parent 61508d9624
commit db7f4c203b
4 changed files with 22 additions and 0 deletions

View File

@ -0,0 +1 @@
bus/usb/1/2

View File

@ -0,0 +1 @@
X=usbdev1.2 X=${X#usbdev} B=${X%%.*} D=${X#*.}; echo bus/usb/$B/$D

View File

@ -0,0 +1,6 @@
a=a A=a
a=a A=a
a= A=
a= A=
a=a A=a
a=a A=a

View File

@ -0,0 +1,14 @@
# check that first assignment has proper effect on second one
(
a=a A=$a
echo a=$a A=$A
)
(a=a A=$a; echo a=$a A=$A)
(a=a A=$a echo a=$a A=$A)
(a=a A=$a /bin/echo a=$a A=$A)
f() { echo a=$a A=$A; }
(a=a A=$a f)
(a=a A=$a; f)