Use a case statement and glob to match the first character of $NEXTLINE, instead of string splitting, which isn't portable. Patch by Andrew Miller. https://bugs.gentoo.org/528380 --- a/common/mkiconlinks.sh +++ b/common/mkiconlinks.sh @@ -16,8 +16,9 @@ while [ ! -z "$NEXTLINE" ] ; do # Skip lines beginning with '#' - if [ ! "${NEXTLINE:0:1}" == '#' ]; then - #Extract first field, minus its trailing colon + case "$NEXTLINE" in + \#*) continue ;; + *) #Extract first field, minus its trailing colon ORIG_FILE=`echo $NEXTLINE | awk '/:/{print $1}' | sed -e 's/://'` #Extract list of following fields @@ -26,8 +27,8 @@ if [ ! -z "$LINKTO" ] ; then echo "Creating symlinks to `pwd`/$ORIG_FILE" fi - - fi + ;; + esac #Link each pair in turn for i in $LINKTO ; do