summaryrefslogtreecommitdiffstats
path: root/runtime/syntax/testdir/input/sh_10.sh
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-13 07:39:57 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-13 07:40:16 +0000
commit6af24b2457752c0d36aaf9f29f03d39afd09937f (patch)
tree2671b594908d1f971de6b2a2d473f97dfb7291d2 /runtime/syntax/testdir/input/sh_10.sh
parentReleasing progress-linux version 2:9.1.0016-1~progress7.99u1. (diff)
downloadvim-6af24b2457752c0d36aaf9f29f03d39afd09937f.tar.xz
vim-6af24b2457752c0d36aaf9f29f03d39afd09937f.zip
Merging upstream version 2:9.1.0199.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'runtime/syntax/testdir/input/sh_10.sh')
-rw-r--r--runtime/syntax/testdir/input/sh_10.sh49
1 files changed, 49 insertions, 0 deletions
diff --git a/runtime/syntax/testdir/input/sh_10.sh b/runtime/syntax/testdir/input/sh_10.sh
new file mode 100644
index 0000000..be463c3
--- /dev/null
+++ b/runtime/syntax/testdir/input/sh_10.sh
@@ -0,0 +1,49 @@
+#!/bin/ksh
+
+# This script is a test file for ksh93 shared-state
+# command substitutions (subshares) and mksh value
+# substitutions (valsubs).
+
+# ======
+# Below is subshare syntax supported by both ksh93 and mksh.
+print ${ echo one }
+print ${ echo two
+}
+print ${
+echo three }
+print ${ echo 'four'; }
+print ${ echo 'five' ;}
+print ${ echo 'six'
+}
+print ${ echo 'seven' }
+echo ${ print 'eight' }
+typeset nine=${ pwd; }
+
+# ======
+# Value substitutions of the form ${|command} are only
+# supported by mksh, not ksh93.
+if ! command eval '((.sh.version >= 20070703))' 2>/dev/null; then
+ valsubfunc() {
+ REPLY=$1
+ }
+ echo ${|valsubfunc ten}
+ print "${|valsubfunc eleven;}"
+ printf '%s' "${|valsubfunc twelve }"
+ unlucky=${|valsubfunc thirteen
+}
+ typeset notafloat=${|valsubfunc notanumber }
+ print $unlucky $notanumber
+ ${|echo foo}
+ ${|echo bar
+}
+fi
+
+# ======
+# Shared-state command substitutions using the syntax ${<file;}
+# are only supported by ksh93, not mksh.
+echo ${
+ printf %s str
+} > /tmp/strfile
+echo ${</tmp/strfile;}
+
+exit 0