summaryrefslogtreecommitdiff
path: root/mnv/runtime/syntax/testdir/input/sh_functions_bash.sh
blob: 1c565923769d8835949b34586c0418f91c26fec4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
#!/bin/bash
# MNV_TEST_SETUP setlocal fen fdc=2 fdl=8 fdm=syntax
# MNV_TEST_SETUP let g:sh_fold_enabled = 1 + 2 + 4


typeset -i n=0
doosie() ((n+=1)); doosie
donee() [[ -n $# ]]; donee

thence()
until :
do
    :
done
thence

whiles() while false; do :; done; whiles

elsewhere() if :
then :; fi; elsewhere

selector() select x in 1 2; do
    break
done
selector 0</dev/null 2>/dev/null || :

cased() case "$#" in *) :;; esac; cased

fore()
for x in 1 2
do
    :
done
fore

iffy() for ((;;))
do
    break
done
iffy

if :; then
    function !?#()
    (
        function @α! {
            echo "$1"
        }
        @α! "$1"
    )
    eval !?\# "$1"
fi

namespace ()
{ echo $#;
}; namespace $@