2006-06-01 17:23:28 +00:00
|
|
|
## Here is an example for Bourne shell scripts.
|
|
|
|
##
|
|
|
|
syntax "sh" "\.sh$"
|
2011-02-13 04:23:10 +00:00
|
|
|
magic "(POSIX|Bourne.*) shell script text"
|
2009-08-18 02:55:22 +00:00
|
|
|
header "^#!.*/(ba|k|pdk)?sh[-0-9_]*"
|
2006-06-01 17:23:28 +00:00
|
|
|
icolor brightgreen "^[0-9A-Z_]+\(\)"
|
2014-02-26 21:33:47 +00:00
|
|
|
color green "\<(break|case|continue|do|done|elif|else|esac|exit|fi|for|function|if|in|read|return|select|shift|then|time|until|while)\>"
|
|
|
|
color green "\<(declare|eval|exec|export|let|local)\>"
|
|
|
|
color green "[{}():;|`$<>!=&\\]" "(\]|\[)"
|
2006-06-01 17:23:28 +00:00
|
|
|
color green "-[Ldefgruwx]\>"
|
|
|
|
color green "-(eq|ne|gt|lt|ge|le|s|n|z)\>"
|
2014-02-26 21:33:47 +00:00
|
|
|
color brightblue "\<(awk|cat|cd|ch(grp|mod|own)|cp|echo|env|grep|install|ln|make|mkdir|mv|popd|printf|pushd|rm|rmdir|sed|set|tar|touch|umask|unset)\>"
|
|
|
|
# Basic variable names (no braces).
|
|
|
|
color brightred "\$[-0-9@*#?$!]" "\$[[:alpha:]_][[:alnum:]_]*"
|
|
|
|
# More complicated variable names; handles braces and replacements and arrays.
|
|
|
|
color brightred "\$\{[#!]?([-@*#?$!]|[0-9]+|[[:alpha:]_][[:alnum:]_]*)(\[([[:space:]]*[[:alnum:]_]+[[:space:]]*|@)\])?(([#%/]|:?[-=?+])[^}]*\}|\[|\})"
|
2006-06-08 12:49:57 +00:00
|
|
|
color cyan "(^|[[:space:]])#.*$"
|
2014-02-26 21:33:47 +00:00
|
|
|
color brightyellow ""(\\.|[^"])*"" "'(\\.|[^'])*'"
|
2007-04-11 22:18:16 +00:00
|
|
|
color ,green "[[:space:]]+$"
|