diff --git a/CHANGELOG.md b/CHANGELOG.md index 3d9a3831..00c0521c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -23,6 +23,7 @@ - Update quadlet syntax mapping to include *.{build,pod} files #3484 (@cyqsimon) - Fix inconsistencies in Ada syntax, see #3481 (@AldanTanneo) - Add syntax mapping for podman's `artifact` quadlet files, see #3497 (@xduugu) +- Highlight Korn Shell scripts (i.e. with a shebang of ...`ksh`) using Bash syntax, see #3509 (@keith-hall) ## Themes diff --git a/assets/acknowledgements.bin b/assets/acknowledgements.bin index 15ec2399..7c534f53 100644 Binary files a/assets/acknowledgements.bin and b/assets/acknowledgements.bin differ diff --git a/assets/patches/ShellScript.sublime-syntax.patch b/assets/patches/ShellScript.sublime-syntax.patch index 5aa7fba1..e34595c0 100644 --- a/assets/patches/ShellScript.sublime-syntax.patch +++ b/assets/patches/ShellScript.sublime-syntax.patch @@ -14,7 +14,7 @@ index e973e319..07c170a7 100644 first_line_match: | (?x) - ^\#! .* \b(bash|zsh|sh|tcsh|ash)\b -+ ^\#! .* \b(bash|zsh|sh|tcsh|ash|dash)\b ++ ^\#! .* \b(bash|zsh|sh|tcsh|ash|dash|ksh)\b | ^\# \s* -\*- [^*]* mode: \s* shell-script [^*]* -\*- #------------------------------------------------------------------------------- diff --git a/assets/syntaxes.bin b/assets/syntaxes.bin index 73d454a8..a9015611 100644 Binary files a/assets/syntaxes.bin and b/assets/syntaxes.bin differ diff --git a/tests/syntax-tests/highlighted/Bash/korn_shell.wrong_ext b/tests/syntax-tests/highlighted/Bash/korn_shell.wrong_ext new file mode 100644 index 00000000..43a47815 --- /dev/null +++ b/tests/syntax-tests/highlighted/Bash/korn_shell.wrong_ext @@ -0,0 +1,19 @@ +#!/bin/ksh +# +# https://www.qnx.com/developers/docs/6.4.0/neutrino/user_guide/scripts.html +# tfind: +# script to look for strings in various files and dump to less + +case $# in +1) + find . -name '*.[ch]' | xargs grep $1 | less + exit 0 # good status +esac + +echo "Use tfind stuff_to_find " +echo " where : stuff_to_find = search string " +echo " " +echo "e.g. tfind console_state looks through all files in "  +echo " the current directory and below and displays all " +echo " instances of console_state." +exit 1 # bad status diff --git a/tests/syntax-tests/source/Bash/korn_shell.wrong_ext b/tests/syntax-tests/source/Bash/korn_shell.wrong_ext new file mode 100644 index 00000000..2c0d6d7e --- /dev/null +++ b/tests/syntax-tests/source/Bash/korn_shell.wrong_ext @@ -0,0 +1,19 @@ +#!/bin/ksh +# +# https://www.qnx.com/developers/docs/6.4.0/neutrino/user_guide/scripts.html +# tfind: +# script to look for strings in various files and dump to less + +case $# in +1) + find . -name '*.[ch]' | xargs grep $1 | less + exit 0 # good status +esac + +echo "Use tfind stuff_to_find " +echo " where : stuff_to_find = search string " +echo " " +echo "e.g. tfind console_state looks through all files in " +echo " the current directory and below and displays all " +echo " instances of console_state." +exit 1 # bad status