7
|
1 " When you're writing shell scripts and you are in doubt which test to use,
|
|
2 " which shell environment variables are defined, what the syntax of the case
|
|
3 " statement is, and you need to invoke 'man sh'?
|
|
4 "
|
|
5 " Your problems are over now!
|
|
6 "
|
|
7 " Attached is a Vim script file for turning gvim into a shell script editor.
|
|
8 " It may also be used as an example how to use menus in Vim.
|
|
9 "
|
|
10 " Written by: Lennart Schultz <les@dmi.min.dk>
|
|
11
|
|
12 imenu Stmts.for for in
do
doneki kk0elli
|
|
13 imenu Stmts.case case in
) ;;
esacbki k0elli
|
|
14 imenu Stmts.if if
then
fiki kk0elli
|
|
15 imenu Stmts.if-else if
then
else
fiki kki kk0elli
|
|
16 imenu Stmts.elif elif
then
ki kk0elli
|
|
17 imenu Stmts.while while
do
doneki kk0elli
|
|
18 imenu Stmts.break break
|
|
19 imenu Stmts.continue continue
|
|
20 imenu Stmts.function () {
}ki k0i
|
|
21 imenu Stmts.return return
|
|
22 imenu Stmts.return-true return 0
|
|
23 imenu Stmts.return-false return 1
|
|
24 imenu Stmts.exit exit
|
|
25 imenu Stmts.shift shift
|
|
26 imenu Stmts.trap trap
|
|
27 imenu Test.existence [ -e ]hi
|
|
28 imenu Test.existence - file [ -f ]hi
|
|
29 imenu Test.existence - file (not empty) [ -s ]hi
|
|
30 imenu Test.existence - directory [ -d ]hi
|
|
31 imenu Test.existence - executable [ -x ]hi
|
|
32 imenu Test.existence - readable [ -r ]hi
|
|
33 imenu Test.existence - writable [ -w ]hi
|
|
34 imenu Test.String is empty [ x = "x$" ]hhi
|
|
35 imenu Test.String is not empty [ x != "x$" ]hhi
|
|
36 imenu Test.Strings is equal [ "" = "" ]hhhhhhhi
|
|
37 imenu Test.Strings is not equal [ "" != "" ]hhhhhhhhi
|
|
38 imenu Test.Values is greater than [ -gt ]hhhhhhi
|
|
39 imenu Test.Values is greater equal [ -ge ]hhhhhhi
|
|
40 imenu Test.Values is equal [ -eq ]hhhhhhi
|
|
41 imenu Test.Values is not equal [ -ne ]hhhhhhi
|
|
42 imenu Test.Values is less than [ -lt ]hhhhhhi
|
|
43 imenu Test.Values is less equal [ -le ]hhhhhhi
|
|
44 imenu ParmSub.Substitute word if parm not set ${:-}hhi
|
|
45 imenu ParmSub.Set parm to word if not set ${:=}hhi
|
|
46 imenu ParmSub.Substitute word if parm set else nothing ${:+}hhi
|
|
47 imenu ParmSub.If parm not set print word and exit ${:?}hhi
|
|
48 imenu SpShVars.Number of positional parameters ${#}
|
|
49 imenu SpShVars.All positional parameters (quoted spaces) ${*}
|
|
50 imenu SpShVars.All positional parameters (unquoted spaces) ${@}
|
|
51 imenu SpShVars.Flags set ${-}
|
|
52 imenu SpShVars.Return code of last command ${?}
|
|
53 imenu SpShVars.Process number of this shell ${$}
|
|
54 imenu SpShVars.Process number of last background command ${!}
|
|
55 imenu Environ.HOME ${HOME}
|
|
56 imenu Environ.PATH ${PATH}
|
|
57 imenu Environ.CDPATH ${CDPATH}
|
|
58 imenu Environ.MAIL ${MAIL}
|
|
59 imenu Environ.MAILCHECK ${MAILCHECK}
|
|
60 imenu Environ.PS1 ${PS1}
|
|
61 imenu Environ.PS2 ${PS2}
|
|
62 imenu Environ.IFS ${IFS}
|
|
63 imenu Environ.SHACCT ${SHACCT}
|
|
64 imenu Environ.SHELL ${SHELL}
|
|
65 imenu Environ.LC_CTYPE ${LC_CTYPE}
|
|
66 imenu Environ.LC_MESSAGES ${LC_MESSAGES}
|
|
67 imenu Builtins.cd cd
|
|
68 imenu Builtins.echo echo
|
|
69 imenu Builtins.eval eval
|
|
70 imenu Builtins.exec exec
|
|
71 imenu Builtins.export export
|
|
72 imenu Builtins.getopts getopts
|
|
73 imenu Builtins.hash hash
|
|
74 imenu Builtins.newgrp newgrp
|
|
75 imenu Builtins.pwd pwd
|
|
76 imenu Builtins.read read
|
|
77 imenu Builtins.readonly readonly
|
|
78 imenu Builtins.return return
|
|
79 imenu Builtins.times times
|
|
80 imenu Builtins.type type
|
|
81 imenu Builtins.umask umask
|
|
82 imenu Builtins.wait wait
|
|
83 imenu Set.set set
|
|
84 imenu Set.unset unset
|
|
85 imenu Set.mark modified or modified variables set -a
|
|
86 imenu Set.exit when command returns non-zero exit code set -e
|
|
87 imenu Set.Disable file name generation set -f
|
|
88 imenu Set.remember function commands set -h
|
|
89 imenu Set.All keyword arguments are placed in the environment set -k
|
|
90 imenu Set.Read commands but do not execute them set -n
|
|
91 imenu Set.Exit after reading and executing one command set -t
|
|
92 imenu Set.Treat unset variables as an error when substituting set -u
|
|
93 imenu Set.Print shell input lines as they are read set -v
|
|
94 imenu Set.Print commands and their arguments as they are executed set -x
|