GNOME Bugzilla – Bug 584581
common/mkiconlinks.sh: uses bashism in a shell script
Last modified: 2009-07-16 14:22:24 UTC
mkiconlinks is declared as a shell script (#!/bin/sh), but uses substring expansion in the following line: if [ ! "${NEXTLINE:0:1}" == '#' ]; then Substring expansion is a feature not found in POSIX implementations of sh(1), and thus fails on systems where /bin/sh is not /bin/bash (or cousins). https://wiki.ubuntu.com/DashAsBinSh#${...} explains the problem, although their solution uses awk where cut would suffice. Something like if [ ! $(echo "$NEXTLINE" | cut -b 1} == '#' ]; then should work.
Created attachment 136898 [details] [review] avoid use of bashism Tested and working, my comment above had a typo.
Gentoo is using similar patch since 2.24.3 - if [ ! "${NEXTLINE:0:1}" == '#' ]; then + if ! echo ${NEXTLINE} | grep -q "^#" ; then http://bugs.gentoo.org/show_bug.cgi?id=256337
*** This bug has been marked as a duplicate of 550927 ***