summaryrefslogtreecommitdiffstats
path: root/runtime/syntax/testdir/input
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2023-06-22 21:57:51 +0100
committerBram Moolenaar <Bram@vim.org>2023-06-22 21:57:51 +0100
commit1aa5f1c21fea60fe64cdcdf6990bf43ea5cc78a0 (patch)
tree658ca00ef7ab8de97335c82a29858187a2427dd4 /runtime/syntax/testdir/input
parent982ded68b660d6c9849bfdc1b0dc469909266e1e (diff)
patch 9.0.1647: insufficient testing for syntax pluginsv9.0.1647
Problem: Insufficient testing for syntax plugins. Solution: Add shell file examples. (Charles Campbell) Create a messages file for easier debugging and reporting the test results.
Diffstat (limited to 'runtime/syntax/testdir/input')
-rw-r--r--runtime/syntax/testdir/input/sh_01.sh4
-rw-r--r--runtime/syntax/testdir/input/sh_02.sh30
-rw-r--r--runtime/syntax/testdir/input/sh_03.sh33
-rw-r--r--runtime/syntax/testdir/input/sh_04.sh27
-rw-r--r--runtime/syntax/testdir/input/sh_05.sh373
-rw-r--r--runtime/syntax/testdir/input/sh_06.sh71
-rw-r--r--runtime/syntax/testdir/input/sh_07.sh93
-rw-r--r--runtime/syntax/testdir/input/sh_08.sh82
-rw-r--r--runtime/syntax/testdir/input/sh_09.sh19
9 files changed, 732 insertions, 0 deletions
diff --git a/runtime/syntax/testdir/input/sh_01.sh b/runtime/syntax/testdir/input/sh_01.sh
new file mode 100644
index 0000000000..2d4f6e8112
--- /dev/null
+++ b/runtime/syntax/testdir/input/sh_01.sh
@@ -0,0 +1,4 @@
+#! /bin/sh
+export `echo 'A=B'`
+printenv A
+echo a `#foo` b
diff --git a/runtime/syntax/testdir/input/sh_02.sh b/runtime/syntax/testdir/input/sh_02.sh
new file mode 100644
index 0000000000..81d5613e1d
--- /dev/null
+++ b/runtime/syntax/testdir/input/sh_02.sh
@@ -0,0 +1,30 @@
+#! /bin/ksh
+# sh2
+# Jul 28, 2018: introduced shCommandSubBQ, which is *not* included in a shSubCommandList (so its not recursive)
+ccc=`echo "test"`
+ ccc=`echo "test"`
+
+# comment
+case $VAR in
+# comment
+ x|y|z) echo xyz ;;
+# comment
+ a|b|c) echo abc ;;
+# comment
+esac
+
+# Jul 26, 2018: why isn't `..` being terminated properly?
+# comment
+case "$aaa" in
+# comment
+ bbb) ccc=`echo $ddd|cut -b4-`
+ echo "test"
+# comment
+ ;;
+# comment
+ esac
+# comment
+
+echo $VAR abc
+export $VAR abc
+set $VAR abc
diff --git a/runtime/syntax/testdir/input/sh_03.sh b/runtime/syntax/testdir/input/sh_03.sh
new file mode 100644
index 0000000000..8dd6dab9c3
--- /dev/null
+++ b/runtime/syntax/testdir/input/sh_03.sh
@@ -0,0 +1,33 @@
+#!/bin/ksh
+# Test variable modifiers
+# Variable=value
+Variable='value'
+Variable="value"
+VariableA="pat1xxpat2"
+VariableB="pat2xxpat1"
+echo ${#}
+echo ${#VariableA}
+echo ${VariableA#pat1}
+echo ${VariableA##pat1}
+echo ${VariableB%pat1}
+echo ${VariableB%%pat1}
+
+# This gets marked as an error
+Variable=${VariableB:+${VariableC:=eng}} # :+ seems to work for ksh as well as bash
+Variable=${VariableB:-${VariableC:-eng}} # :- is ksh and bash
+
+# This is OK
+Variable='${VariableB:+${VariableC:=eng}}'
+Variable='${VariableB:-${VariableC:-eng}}'
+Variable="${VariableB:+${VariableC:=eng}}" # :+ seems to work for ksh as well as bash
+Variable="${VariableB:-${VariableC:-eng}}" # :- is ksh and bash
+
+# These are OK
+: ${VariableB:-${VariableC:-eng}}
+: "${VariableB:-${VariableC:-eng}}"
+: '${VariableB:-${VariableC:-eng}}'
+
+# Another test
+Variable=${VariableB:-${VariableC:-${VariableD:-${VariableE:=eng}}}}
+ : ${VariableB:=${VariableC:-${VariableD:-${VariableE:=eng}}}}
+
diff --git a/runtime/syntax/testdir/input/sh_04.sh b/runtime/syntax/testdir/input/sh_04.sh
new file mode 100644
index 0000000000..5c6ab04ce5
--- /dev/null
+++ b/runtime/syntax/testdir/input/sh_04.sh
@@ -0,0 +1,27 @@
+#!/bin/sh
+# sh4
+Variable=${VariableB:-{VariableC}}
+Variable=${VariableB:-${VariableC:-{Var3:=eng}}}
+
+# This gets marked as an error while its ok
+Variable=${VariableB:-${VariableC:-{Var3:=eng}}}
+Variable=${VariableB:=${VariableC:={Var3:=${Var4:-eng}}}}
+Variable=${VariableB:=${VariableC:={Var3:=${Var4:-${Var5:-eng}}}}}
+Variable=${VariableB:=${VariableC:={Var3:=${Var4:-${Var5:-$Var6}}}}}
+
+# These are OK
+Variable="${VariableB:-${VariableC:-{Var3:=eng}}}"
+Variable="${VariableB:=${VariableC:={Var3:=${Var4:-eng}}}}"
+
+# This gets marked as an error too
+: ${VariableB:-${VariableC:-{Var3:=eng}}}
+: ${VariableB:=${VariableC:={Var3:=${Var4:-eng}}}}
+
+# This is OK
+: ${VariableB:-${VariableC:-eng}}
+: "${VariableB:-${VariableC:-eng}}"
+
+# First line is OK except its missing a closing "}",
+# so second line should have some error highlighting
+Variable=${VariableB:=${VariableC:={Var3:=${Var4:-eng}}}
+Variable=${VariableB:-${VariableC:-{Var3:=eng}}
diff --git a/runtime/syntax/testdir/input/sh_05.sh b/runtime/syntax/testdir/input/sh_05.sh
new file mode 100644
index 0000000000..e86c834e73
--- /dev/null
+++ b/runtime/syntax/testdir/input/sh_05.sh
@@ -0,0 +1,373 @@
+#!/bin/sh -x
+# sh5
+# Note that this is special for sh. ksh will be an extra file later.
+# Note too, that sh and ksh allow ${var:-sub} as well as ${var-sub}!
+# The ':' is optional!
+
+# This all should be OK
+# Case 0a
+[ -t 0 ] && date
+Variable1=value1
+Variable2='value2'
+Variable3="value3"
+echo "$Variable1" "$Variable2" "$Variable3"
+
+# Case 0b
+[ -t 0 ] && echo "\ndate"
+Variable1=$HOME
+Variable2='$HOME'
+Variable3="$HOME"
+echo "$Variable1" "$Variable2" "$Variable3"
+
+# Case 0c
+[ -t 0 ] && echo "\ndate"
+Variable1=$HOME$SHELL
+Variable2=$HOME.$SHELL
+Variable3=$HOME.$SHELL+$HOME-$SHELL/$HOME
+echo "$Variable1" "$Variable2" "$Variable3"
+
+# Case 0d
+[ -t 0 ] && echo "\ndate"
+Variable1=`date`
+Variable2=`id -ng`
+Variable3=`id -ng | wc -c`
+echo "$Variable1" "$Variable2" "$Variable3"
+
+################################################################################
+#
+# Case 1a with constants
+[ -t 0 ] && echo "\ndate"
+Variable1=${VariableA:=eng1}
+Variable2=${VariableA:-eng2}
+Variable3=${VariableA:?eng3}
+Variable3=${VariableA:+eng3}
+echo "$Variable1" "$Variable2" "$Variable3"
+
+# Case 1b with constants in single quotes
+[ -t 0 ] && echo "\ndate"
+Variable1=${VariableA:='eng1'}
+Variable2=${VariableA:-'eng2'}
+Variable3=${VariableA:?'eng3'}
+Variable3=${VariableA:+'eng3'}
+echo "$Variable1" "$Variable2" "$Variable3"
+
+# Case 1c with constants in double quotes
+[ -t 0 ] && echo "\ndate"
+Variable1=${VariableA:="eng1"}
+Variable2=${VariableA:-"eng2"}
+Variable3=${VariableA:?"eng3"}
+Variable3=${VariableA:+"eng3"}
+echo "$Variable1" "$Variable2" "$Variable3"
+
+# Case 1d: constants but missing colons
+Variable1=${VariableA=eng1}
+Variable2=${VariableA-eng2}
+Variable3=${VariableA?eng3}
+Variable3=${VariableA+eng3}
+Variable1=${VariableA='eng1'}
+Variable2=${VariableA-'eng2'}
+Variable3=${VariableA?'eng3'}
+Variable3=${VariableA+'eng3'}
+Variable1=${VariableA="eng1"}
+Variable2=${VariableA-"eng2"}
+Variable3=${VariableA?"eng3"}
+Variable3=${VariableA+"eng3"}
+
+# Case 2a with a variable
+[ -t 0 ] && echo "\ndate"
+Variable1=${VariableA:=$HOME}
+Variable2=${VariableA:-$HOME}
+Variable3=${VariableA:?$HOME}
+Variable3=${VariableA:+$HOME}
+echo "$Variable1" "$Variable2" "$Variable3"
+
+# Case 2b with a variable in single quotes
+[ -t 0 ] && echo "\ndate"
+Variable1=${VariableA:='$HOME'}
+Variable2=${VariableA:-'$HOME'}
+Variable3=${VariableA:?'$HOME'}
+Variable3=${VariableA:+'$HOME'}
+echo "$Variable1" "$Variable2" "$Variable3"
+
+# Case 2c with a variable in double quotes
+[ -t 0 ] && echo "\ndate"
+Variable1=${VariableA:="$HOME"}
+Variable2=${VariableA:-"$HOME"}
+Variable3=${VariableA:?"$HOME"}
+Variable3=${VariableA:+"$HOME"}
+echo "$Variable1" "$Variable2" "$Variable3"
+
+# Case 3a with a command substitution
+[ -t 0 ] && echo "\ndate"
+Variable1=${VariableA:=`date`}
+Variable2=${VariableA:-`date`}
+Variable3=${VariableA:?`date`}
+Variable3=${VariableA:+`date`}
+echo "$Variable1" "$Variable2" "$Variable3"
+
+# Case 3b with a command + option substitution
+[ -t 0 ] && echo "\ndate"
+Variable1=${VariableA:=`id -ng`}
+Variable2=${VariableA:-`id -ng`}
+Variable3=${VariableA:?`id -ng`}
+Variable3=${VariableA:+`id -ng`}
+echo "$Variable1" "$Variable2" "$Variable3"
+
+# Case 3c with a command + pipe substitution
+[ -t 0 ] && echo "\ndate"
+Variable1=${VariableA:=`id -ng | wc -c`}
+Variable2=${VariableA:-`id -ng | wc -c`}
+Variable3=${VariableA:?`id -ng | wc -c`}
+Variable3=${VariableA:+`id -ng | wc -c`}
+echo "$Variable1" "$Variable2" "$Variable3"
+
+################################################################################
+#
+# The same with one nestet ${} level
+# Case 1a with constants
+[ -t 0 ] && echo "\ndate"
+Variable1=${VariableA:-${VarB:=eng1}}
+Variable2=${VariableA:-${VarB:-eng2}}
+Variable3=${VariableA:-${VarB:?eng3}}
+Variable3=${VariableA:-${VarB:+eng3}}
+echo "$Variable1" "$Variable2" "$Variable3"
+
+# Case 1b with constants in single quotes
+[ -t 0 ] && echo "\ndate"
+Variable1=${VariableA:-${VarB:='eng1'}}
+Variable2=${VariableA:-${VarB:-'eng2'}}
+Variable3=${VariableA:-${VarB:?'eng3'}}
+Variable3=${VariableA:-${VarB:+'eng3'}}
+echo "$Variable1" "$Variable2" "$Variable3"
+
+# Case 1c with constants in double quotes
+[ -t 0 ] && echo "\ndate"
+Variable1=${VariableA:-${VarB:="eng1"}}
+Variable2=${VariableA:-${VarB:-"eng2"}}
+Variable3=${VariableA:-${VarB:?"eng3"}}
+Variable3=${VariableA:-${VarB:+"eng3"}}
+echo "$Variable1" "$Variable2" "$Variable3"
+
+# Case 2a with a variable
+[ -t 0 ] && echo "\ndate"
+Variable1=${VariableA:-${VarB:=$HOME}}
+Variable2=${VariableA:-${VarB:-$HOME}}
+Variable3=${VariableA:-${VarB:?$HOME}}
+Variable3=${VariableA:-${VarB:+$HOME}}
+echo "$Variable1" "$Variable2" "$Variable3"
+
+# Case 2b with a variable in single quotes
+[ -t 0 ] && echo "\ndate"
+Variable1=${VariableA:-${VarB:='$HOME'}}
+Variable2=${VariableA:-${VarB:-'$HOME'}}
+Variable3=${VariableA:-${VarB:?'$HOME'}}
+Variable3=${VariableA:-${VarB:+'$HOME'}}
+echo "$Variable1" "$Variable2" "$Variable3"
+
+# Case 2c with a variable in double quotes
+[ -t 0 ] && echo "\ndate"
+Variable1=${VariableA:-${VarB:="$HOME"}}
+Variable2=${VariableA:-${VarB:-"$HOME"}}
+Variable3=${VariableA:-${VarB:?"$HOME"}}
+Variable3=${VariableA:-${VarB:+"$HOME"}}
+echo "$Variable1" "$Variable2" "$Variable3"
+
+# Case 3a with a command substitution
+[ -t 0 ] && echo "\ndate"
+Variable1=${VariableA:-${VarB:=`date`}}
+Variable2=${VariableA:-${VarB:-`date`}}
+Variable3=${VariableA:-${VarB:?`date`}}
+Variable3=${VariableA:-${VarB:+`date`}}
+echo "$Variable1" "$Variable2" "$Variable3"
+
+# Case 3b with a command + option substitution
+[ -t 0 ] && echo "\ndate"
+Variable1=${VariableA:-${VarB:=`id -ng`}}
+Variable2=${VariableA:-${VarB:-`id -ng`}}
+Variable3=${VariableA:-${VarB:?`id -ng`}}
+Variable3=${VariableA:-${VarB:+`id -ng`}}
+echo "$Variable1" "$Variable2" "$Variable3"
+
+# Case 3c with a command + pipe substitution
+[ -t 0 ] && echo "\ndate"
+Variable1=${VariableA:-${VarB:=`id -ng | wc -c`}}
+Variable2=${VariableA:-${VarB:-`id -ng | wc -c`}}
+Variable3=${VariableA:-${VarB:?`id -ng | wc -c`}}
+Variable3=${VariableA:-${VarB:+`id -ng | wc -c`}}
+echo "$Variable1" "$Variable2" "$Variable3"
+
+################################################################################
+#
+# The same with two nestet ${} level
+# Case 1a with constants
+[ -t 0 ] && echo "\ndate"
+Variable1=${VariableA:-${VarB:-${VarC:=eng1}}}
+Variable2=${VariableA:-${VarB:-${VarC:-eng2}}}
+Variable3=${VariableA:-${VarB:-${VarC:?eng3}}}
+Variable3=${VariableA:-${VarB:-${VarC:+eng3}}}
+echo "$Variable1" "$Variable2" "$Variable3"
+
+# Case 1b with constants in single quotes
+[ -t 0 ] && echo "\ndate"
+Variable1=${VariableA:-${VarB:-${VarC:='eng1'}}}
+Variable2=${VariableA:-${VarB:-${VarC:-'eng2'}}}
+Variable3=${VariableA:-${VarB:-${VarC:?'eng3'}}}
+Variable3=${VariableA:-${VarB:-${VarC:+'eng3'}}}
+echo "$Variable1" "$Variable2" "$Variable3"
+
+# Case 1c with constants in double quotes
+[ -t 0 ] && echo "\ndate"
+Variable1=${VariableA:-${VarB:-${VarC:="eng1"}}}
+Variable2=${VariableA:-${VarB:-${VarC:-"eng2"}}}
+Variable3=${VariableA:-${VarB:-${VarC:?"eng3"}}}
+Variable3=${VariableA:-${VarB:-${VarC:+"eng3"}}}
+echo "$Variable1" "$Variable2" "$Variable3"
+
+# Case 2a with a variable
+[ -t 0 ] && echo "\ndate"
+Variable1=${VariableA:-${VarB:-${VarC:=$HOME}}}
+Variable2=${VariableA:-${VarB:-${VarC:-$HOME}}}
+Variable3=${VariableA:-${VarB:-${VarC:?$HOME}}}
+Variable3=${VariableA:-${VarB:-${VarC:+$HOME}}}
+echo "$Variable1" "$Variable2" "$Variable3"
+
+# Case 2b with a variable in single quotes
+[ -t 0 ] && echo "\ndate"
+Variable1=${VariableA:-${VarB:-${VarC:='$HOME'}}}
+Variable2=${VariableA:-${VarB:-${VarC:-'$HOME'}}}
+Variable3=${VariableA:-${VarB:-${VarC:?'$HOME'}}}
+Variable3=${VariableA:-${VarB:-${VarC:+'$HOME'}}}
+echo "$Variable1" "$Variable2" "$Variable3"
+
+# Case 2c with a variable in double quotes
+[ -t 0 ] && echo "\ndate"
+Variable1=${VariableA:-${VarB:-${VarC:="$HOME"}}}
+Variable2=${VariableA:-${VarB:-${VarC:-"$HOME"}}}
+Variable3=${VariableA:-${VarB:-${VarC:?"$HOME"}}}
+Variable3=${VariableA:-${VarB:-${VarC:?"$HOME"}}}
+Variable3=${VariableA:-${VarB:-${VarC:+"$HOME"}}}
+echo "$Variable1" "$Variable2" "$Variable3"
+
+# Case 3a with a command substitution
+[ -t 0 ] && echo "\ndate"
+Variable1=${VariableA:-${VarB:-${VarC:=`date`}}}
+Variable2=${VariableA:-${VarB:-${VarC:-`date`}}}
+Variable3=${VariableA:-${VarB:-${VarC:?`date`}}}
+Variable3=${VariableA:-${VarB:-${VarC:+`date`}}}
+echo "$Variable1" "$Variable2" "$Variable3"
+
+# Case 3b with a command + option substitution
+[ -t 0 ] && echo "\ndate"
+Variable1=${VariableA:-${VarB:-${VarC:=`id -ng`}}}
+Variable2=${VariableA:-${VarB:-${VarC:-`id -ng`}}}
+Variable3=${VariableA:-${VarB:-${VarC:?`id -ng`}}}
+Variable3=${VariableA:-${VarB:-${VarC:+`id -ng`}}}
+echo "$Variable1" "$Variable2" "$Variable3"
+
+# Case 3c with a command + pipe substitution
+[ -t 0 ] && echo "\ndate"
+Variable1=${VariableA:-${VarB:-${VarC:=`id -ng | wc -c`}}}
+Variable2=${VariableA:-${VarB:-${VarC:-`id -ng | wc -c`}}}
+Variable3=${VariableA:-${VarB:-${VarC:?`id -ng | wc -c`}}}
+Variable3=${VariableA:-${VarB:-${VarC:+`id -ng | wc -c`}}}
+echo "$Variable1" "$Variable2" "$Variable3"
+
+
+################################################################################
+#
+# The same with three nestet ${} level
+# Case 1a with constants
+[ -t 0 ] && echo "\ndate"
+Variable1=${VariableA:-${VarB:-${VarC:-${VarD:=eng1}}}}
+Variable2=${VariableA:-${VarB:-${VarC:-${VarD:-eng2}}}}
+Variable3=${VariableA:-${VarB:-${VarC:-${VarD:?eng3}}}}
+Variable3=${VariableA:-${VarB:-${VarC:-${VarD:+eng3}}}}
+echo "$Variable1" "$Variable2" "$Variable3"
+
+# Case 1b with constants in single quotes
+[ -t 0 ] && echo "\ndate"
+Variable1=${VariableA:-${VarB:-${VarC:-${VarD:='eng1'}}}}
+Variable2=${VariableA:-${VarB:-${VarC:-${VarD:-'eng2'}}}}
+Variable3=${VariableA:-${VarB:-${VarC:-${VarD:?'eng3'}}}}
+Variable3=${VariableA:-${VarB:-${VarC:-${VarD:+'eng3'}}}}
+echo "$Variable1" "$Variable2" "$Variable3"
+
+# Case 1c with constants in double quotes
+[ -t 0 ] && echo "\ndate"
+Variable1=${VariableA:-${VarB:-${VarC:-${VarD:="eng1"}}}}
+Variable2=${VariableA:-${VarB:-${VarC:-${VarD:-"eng2"}}}}
+Variable3=${VariableA:-${VarB:-${VarC:-${VarD:?"eng3"}}}}
+Variable3=${VariableA:-${VarB:-${VarC:-${VarD:+"eng3"}}}}
+echo "$Variable1" "$Variable2" "$Variable3"
+
+# Case 2a with a variable
+[ -t 0 ] && echo "\ndate"
+Variable1=${VariableA:-${VarB:-${VarC:-${VarD:=$HOME}}}}
+Variable2=${VariableA:-${VarB:-${VarC:-${VarD:-$HOME}}}}
+Variable3=${VariableA:-${VarB:-${VarC:-${VarD:?$HOME}}}}
+Variable3=${VariableA:-${VarB:-${VarC:-${VarD:+$HOME}}}}
+echo "$Variable1" "$Variable2" "$Variable3"
+
+# Case 2b with a variable in single quotes
+[ -t 0 ] && echo "\ndate"
+Variable1=${VariableA:-${VarB:-${VarC:-${VarD:='$HOME'}}}}
+Variable2=${VariableA:-${VarB:-${VarC:-${VarD:-'$HOME'}}}}
+Variable3=${VariableA:-${VarB:-${VarC:-${VarD:?'$HOME'}}}}
+Variable3=${VariableA:-${VarB:-${VarC:-${VarD:+'$HOME'}}}}
+echo "$Variable1" "$Variable2" "$Variable3"
+
+# Case 2c with a variable in double quotes
+[ -t 0 ] && echo "\ndate"
+Variable1=${VariableA:-${VarB:-${VarC:-${VarD:="$HOME"}}}}
+Variable2=${VariableA:-${VarB:-${VarC:-${VarD:-"$HOME"}}}}
+Variable3=${VariableA:-${VarB:-${VarC:-${VarD:?"$HOME"}}}}
+Variable3=${VariableA:-${VarB:-${VarC:-${VarD:+"$HOME"}}}}
+echo "$Variable1" "$Variable2" "$Variable3"
+
+# Case 3a with a command substitution
+[ -t 0 ] && echo "\ndate"
+Variable1=${VariableA:-${VarB:-${VarC:-${VarD:=`date`}}}}
+Variable2=${VariableA:-${VarB:-${VarC:-${VarD:-`date`}}}}
+Variable3=${VariableA:-${VarB:-${VarC:-${VarD:?`date`}}}}
+Variable3=${VariableA:-${VarB:-${VarC:-${VarD:+`date`}}}}
+echo "$Variable1" "$Variable2" "$Variable3"
+
+# Case 3b with a command + option substitution
+[ -t 0 ] && echo "\ndate"
+Variable1=${VariableA:-${VarB:-${VarC:-${VarD:=`id -ng`}}}}
+Variable2=${VariableA:-${VarB:-${VarC:-${VarD:-`id -ng`}}}}
+Variable3=${VariableA:-${VarB:-${VarC:-${VarD:?`id -ng`}}}}
+Variable3=${VariableA:-${VarB:-${VarC:-${VarD:+`id -ng`}}}}
+echo "$Variable1" "$Variable2" "$Variable3"
+
+# Case 3c with a command + pipe substitution
+[ -t 0 ] && echo "\ndate"
+Variable1=${VariableA:-${VarB:-${VarC:-${VarD:=`id -ng | wc -c`}}}}
+Variable2=${VariableA:-${VarB:-${VarC:-${VarD:-`id -ng | wc -c`}}}}
+Variable3=${VariableA:-${VarB:-${VarC:-${VarD:?`id -ng | wc -c`}}}}
+Variable3=${VariableA:-${VarB:-${VarC:-${VarD:+`id -ng | wc -c`}}}}
+echo "$Variable1" "$Variable2" "$Variable3"
+
+
+################################################################################
+#
+# This is also allowed:
+Variable1=${VariableA-${VarB-${VarC-${VarD=`id -ng | wc -c`}}}}
+
+################################################################################
+#
+# All cases with ${Var:?} which works for the sh:
+Variable4=${Variable4:?}
+Variable4=${Variable4:?OK}
+Variable4=${Variable4:?`date`}
+Variable4=${Variable4:?'an OK string'}
+Variable4=${Variable4:?"an OK string"}
+Variable4=${Variable4:?$HOME$SHELL}
+Variable4=${Variable4:?$HOME:$SHELL}
+
+# All cases with ${Var:?} which works also for ksh:
+Variable4=${Variable4:?This is OK}
+Variable4=${Variable4:?This is OK, too: `date`}
+
+# What happens with ${#identifier[*]}:
+Variable5=${#identifier[*]}
diff --git a/runtime/syntax/testdir/input/sh_06.sh b/runtime/syntax/testdir/input/sh_06.sh
new file mode 100644
index 0000000000..cec6cc30af
--- /dev/null
+++ b/runtime/syntax/testdir/input/sh_06.sh
@@ -0,0 +1,71 @@
+#!/bin/ksh
+# Shall we debug this script? If so, remove the '#' before '#DebugScript=set'
+DebugScript=set
+
+# Show that we are busy.
+[ -t 0 ] && echo "Please wait ... \c" >`tty`
+
+################################################################################
+#
+# Display some Help
+#
+Usage () {
+
+# does this comment work?
+VariableName="${BasicConfigName}_*"
+
+# Echo some ksh special variables
+echo "CDPATH="${CDPATH}
+
+# Get also a short description of the backuptype/method
+eval BackupMethod=\$mess09${BackupType}B
+
+case $BackupType in
+ 3) DefaultDevice=$MountDevice ;;
+ 1|2) DefaultDevice=$TapeDrive ;;
+esac
+
+# If we have more the 53 characters in the variables below split them up
+# into several lines and add 3 tabs before them
+for Variable in DefaultExclude DefaultFindOption DoNotBackupList
+do
+ eval VarValue=\$$Variable
+ VarValue=`echo $VarValue | FoldS 53 | sed "2,\\$s/^/$Tab$Tab$Tab/"`
+ eval $Variable=\$VarValue
+done
+
+echo "
+Usage: $ScriptName [-Options]
+
+Options List:
+ -v The current version of '$ScriptName'
+ -h | -H | ? Display this list
+
+"
+
+} # End of Usage
+
+
+################################################################################
+#
+# Create a backup using fbackup/frecover
+#
+ExecuteFbackup () { # TESTING
+
+[ "$DebugScript" ] && set -x || set +x
+
+cd $cwd
+
+} # End of ExecuteFbackup
+
+
+################################################################################
+# main ### main ### main ### main ### main ### main ### main ### main ### main #
+################################################################################
+#
+# Here is the heart of this script:
+#
+Usage
+
+# And exit
+Exit $Result
diff --git a/runtime/syntax/testdir/input/sh_07.sh b/runtime/syntax/testdir/input/sh_07.sh
new file mode 100644
index 0000000000..6fc4931765
--- /dev/null
+++ b/runtime/syntax/testdir/input/sh_07.sh
@@ -0,0 +1,93 @@
+#!/bin/sh
+# Test file to test 'for do done' loops.
+# You can start this script like: $0 {-ne -gt -le ...} (all numeric operators
+# are allowed!
+
+# All this works and should be OK
+
+################################################################################
+#
+# For loop without 'in list'. Uses $1 $2 ... This is a special case!
+# This 'for Var, do, done' is a very handy solution AND no real replacement
+# available!
+#
+Function1 () {
+
+echo "Function1: for loop inside a function:\t\c"
+[ "$*" ] || echo "none\c"
+
+for Var
+do
+ [ 1 $Var 2 ] && echo "OK \c" || echo "no \c"
+done
+echo
+
+} # End of Function1
+
+################################################################################
+#
+# For loop with 'in list' $*
+#
+Function2 () {
+
+echo "Function2: for loop inside a function:\t\c"
+for Var in $*
+do
+ [ 1 $Var 2 ] && echo "OK \c" || echo "no \c"
+done ; echo
+
+} # End of Function2
+
+################################################################################
+#
+# For loop with 'in list' $@. Works the same way as $*
+#
+Function3 () {
+
+echo "Function3: for loop inside a function:\t\c"
+for Var in $@
+do
+ [ 1 $Var 2 ] && echo "OK \c" || echo "no \c"
+done ; echo
+
+} # End of Function3
+
+################################################################################
+#
+# For loop with 'in list' "$@". Special case. Works like "$1" "$2" ...
+#
+Function4 () {
+
+echo "Function4: for loop inside a function:\t\c"
+for Var in "$@"
+do
+ [ 1 $Var 2 ] && echo "OK \c" || echo "no \c"
+done ; echo
+
+} # End of Function4
+
+
+################################################################################
+# main ### main ### main ### main ### main ### main ### main ### main ### main #
+################################################################################
+#
+# Here is the heart of this script:
+#
+echo "Processing the following command line arguements: ${*:-none}"
+echo "Script: for loop outside a function:\t\c"
+for Var
+do
+ [ 1 $Var 2 ] && echo "OK \c" || echo "no \c"
+done ; echo
+
+# Same as function calls
+Function1 -eq -ne -gt -ge -le -lt
+Function2 -eq -ne -gt -ge -le -lt
+Function3 -eq -ne -gt -ge -le -lt
+Function4 -eq -ne -gt -ge -le -lt '-ge 1 -a 2 -ge'
+
+# Now the same call like Function4 but with Function1
+Function1 -eq -ne -gt -ge -le -lt '-ge 1 -a 2 -ge'
+Function1
+
+exit $?
diff --git a/runtime/syntax/testdir/input/sh_08.sh b/runtime/syntax/testdir/input/sh_08.sh
new file mode 100644
index 0000000000..2b80d43ba6
--- /dev/null
+++ b/runtime/syntax/testdir/input/sh_08.sh
@@ -0,0 +1,82 @@
+#!/bin/ksh -p
+
+# Note that this is special test file for ksh. sh is an extra file.
+# Note too, that this file contains ONLY things which works for ksh BUT NOT
+# for sh
+
+# This all should be OK
+
+# Several keywords without any quotes!
+# Case 1a. Several Constants
+[ -t 0 ] && date
+Variable1=${VariableA:-This is a Text}
+Variable2=${VariableA:=This is a Text}
+Variable3=${VariableA:?This is a Text}
+echo "$Variable1" ; echo "$Variable2" ; echo "$Variable3"
+
+# Case 1b. Variable and Constant
+[ -t 0 ] && echo "\n`date`" && unset VariableA
+Variable1=${VariableA:-$HOME This is a Text}
+Variable2=${VariableA:=$HOME This is a Text}
+Variable3=${VariableA:?$HOME This is a Text}
+echo "$Variable1" ; echo "$Variable2" ; echo "$Variable3"
+
+# Case 1c. Constant and Variable
+[ -t 0 ] && echo "\n`date`" && unset VariableA
+Variable1=${VariableA:-This is a Text in $HOME}
+Variable2=${VariableA:=This is a Text in $HOME}
+Variable3=${VariableA:+This is a Text in $HOME} #! :+ is bash-only, error here expected
+Variable1=${VariableA:-This is a Text in $HOME too}
+Variable2=${VariableA:=This is a Text in $HOME too}
+Variable3=${VariableA:+This is a Text in $HOME too}
+echo "$Variable1" ; echo "$Variable2" ; echo "$Variable3"
+
+# Case 1d. More Variables and Constants. Starting with a Variable.
+[ -t 0 ] && echo "\n`date`" && unset VariableA
+Variable1=${VariableA:-$SHELL}
+Variable1=${VariableA:-$SHELL This is a Text in $HOME}
+Variable2=${VariableA:=$SHELL This is a Text in $HOME}
+Variable3=${VariableA:+$SHELL This is a Text in $HOME}
+echo "$Variable1" ; echo "$Variable2" ; echo "$Variable3"
+
+# Case 1e. More Constants and Variables. Starting with a Constant.
+[ -t 0 ] && echo "\n`date`" && unset VariableA
+Variable1=${VariableA:-"This is a Text in $HOME $SHELL"}
+Variable1=${VariableA:-This is a Text in $HOME $SHELL}
+Variable2=${VariableA:=This is a Text in $HOME $SHELL}
+Variable3=${VariableA:+This is a Text in $HOME $SHELL}
+echo "$Variable1" ; echo "$Variable2" ; echo "$Variable3"
+
+# Case 1x. The same with ':'
+[ -t 0 ] && echo "\n`date`" && unset VariableA
+: ${VariableA:-This is a Text}
+: ${VariableA:-$HOME This is a Text}
+: ${VariableA:-This is a Text in $HOME}
+: ${VariableA:-$SHELL This is a Text in $HOME}
+: ${VariableA:-This is a Text in $HOME $SHELL}
+
+# Case 1y. The same with ':' and without the ':' in the parameter substitution
+[ -t 0 ] && echo "\n`date`" && unset VariableA
+: ${VariableA-This is a Text}
+: ${VariableA-$HOME This is a Text}
+: ${VariableA-This is a Text in $HOME}
+: ${VariableA-$SHELL This is a Text in $HOME}
+: ${VariableA-This is a Text in $HOME $SHELL}
+
+################################################################################
+#
+# This are valid usages for ${Var:?} in ksh!
+#
+Variable4=${Variable4:?This is an Error Message}
+Variable4=${Variable4:?This is an Error Message from `date`}
+
+: ${Variable4:?This is an Error Message}
+: ${Variable4:?This is an Error Message from `date`}
+
+exit $?
+
+# Michael Soulier
+if [ $# -ne 1 ]; then
+ echo whatever
+ exit 1
+fi
diff --git a/runtime/syntax/testdir/input/sh_09.sh b/runtime/syntax/testdir/input/sh_09.sh
new file mode 100644
index 0000000000..9888ade98b
--- /dev/null
+++ b/runtime/syntax/testdir/input/sh_09.sh
@@ -0,0 +1,19 @@
+#!/bin/sh
+# Test file for vim the check () subshells
+( cd ; $pwd ) | wc -c
+( cd $1 ; $pwd ) | wc -c
+( cd ${1} ; $pwd ) | wc -c
+( cd ; $pwd ) | wc -c
+( cd ${1:-.} ; $pwd ) | sed -e 's!$!/!' -e 's!//*$!/!'
+( cd ; $pwd ) | wc -c
+( cd ${1:+.} ; $pwd ) | wc -c
+( cd ; $pwd ) | wc -c
+( cd ${1:=.} ; $pwd ) | wc -c
+( cd ; $pwd ) | wc -c
+( cd ${1:?} ; $pwd ) | wc -c
+( cd ; $pwd ) | wc -c
+( cd $HOME ; $pwd ) | wc -c
+( cd ${HOME} ; $pwd ) | wc -c
+( cd ${HOME} ) | wc -c
+((n=1+2))
+let n=1+2