From fedb9cd4bfd6fbd97c15f993b226e134ca0f466a Mon Sep 17 00:00:00 2001 From: Axel Beckert Date: Sun, 11 Apr 2010 09:44:35 +0200 Subject: [PATCH] Make contrib/list-xulrunner-versions POSIX compatible --- contrib/list-xulrunner-versions | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/contrib/list-xulrunner-versions b/contrib/list-xulrunner-versions index 01cbd09..c883c6d 100755 --- a/contrib/list-xulrunner-versions +++ b/contrib/list-xulrunner-versions @@ -1,4 +1,4 @@ -#! /bin/bash +#! /bin/sh # (C) Copyright 2010 John J. Foerch # @@ -8,22 +8,22 @@ # This program lists the versions of XULRunner registered on the system, their # installation path, and whether they exist. -versions=($(grep -h '^\[' "$HOME"/.gre.d/*.conf /etc/gre.d/*.conf 2>/dev/null | sort -urV)) -for version in "${versions[@]}"; do +versions=$(grep -h '^\[' "$HOME"/.gre.d/*.conf /etc/gre.d/*.conf 2>/dev/null | sort -urV) +for version in ${versions}; do xrdir=$(grep -Fxh -A2 -m1 "$version" "$HOME"/.gre.d/*.conf /etc/gre.d/*.conf 2>/dev/null |\ grep GRE_PATH |\ cut -d= -f2) xulrunner="${xrdir%/}/xulrunner" - if [[ -x "$xulrunner" ]]; then - echo -n " " + if [ -x "$xulrunner" ]; then + printf " " else - echo -n "?" + printf "?" missing=1 fi - echo -e " $version\t$xrdir" + printf " $version\t$xrdir\n" done -if [[ -n "$missing" ]]; then +if [ -n "$missing" ]; then echo echo "XULRunner versions marked with a ? are registered but not installed." echo "They can be safely cleaned out of /etc/gre.d/ and ~/.gre.d/." -- 2.11.4.GIT