Skip to content

Ensure POSIX-compliant shell scripting to support DASH

Lucy Llewellyn requested to merge lucyllewy/xdg-utils:issue-10 into master

Some systems, such as Ubuntu, use DASH to provide /bin/sh instead of BASH. This means that we need to use POSIX compliant shell scripting as BASHisms are unsupported in DASH. There are two BASH variable substition instances within the code of xdg-settings.in that cause KDE users to be unable to find the current web browser because the script dies when hitting this unsupported code.

DASH also doesn't support the BASHism that allows == inside [] tests.

  • Replace ${variable:0:1} with printf-based equivalent.
  • Replace use of == with =

Fixes #10 (closed), #203 (closed)

Signed-off-by: Lucy Llewellyn lucyllewy@ubuntu.com

Edited by Lucy Llewellyn

Merge request reports