From 7d8a2b65fda6cd2d8a946099e0e896d37ce1b3fa Mon Sep 17 00:00:00 2001 From: Gioele Barabucci Date: Wed, 7 Aug 2024 07:09:37 +0200 Subject: [PATCH] tools/bufs_compare_dir: Make compatible with POSIX sh `bufr_compare_dir` is the only installed script that requires `ksh`. With minor changes it is possible to make this script compatible with standard POSIX sh. Removing the need to use `ksh` greatly simplifies many aspects of the efforts needed to package, install and maintain eccodes in distributions like Debian. See: https://bugs.debian.org/1078095 --- tools/bufr_compare_dir | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tools/bufr_compare_dir b/tools/bufr_compare_dir index 33adb21b6..67ef362f2 100755 --- a/tools/bufr_compare_dir +++ b/tools/bufr_compare_dir @@ -1,23 +1,23 @@ -#!/bin/ksh +#!/bin/sh keys="md5Structure,md5Data,typicalDate,typicalTime,rdbType,rdbSubtype,ident,satelliteID,localLatitude,localLongitude,localLatitude1,localLongitude1,localLatitude2,localLongitude2" opt="" -if [[ $# -eq 3 ]] +if [ $# -eq 3 ] then opt=$1 dir1=$2 dir2=$3 fi -if [[ $# -eq 2 ]] +if [ $# -eq 2 ] then dir1=$1 dir2=$2 fi -if [[ $# -gt 3 ]] || [[ $# -lt 2 ]] +if [ $# -gt 3 ] || [ $# -lt 2 ] then echo usage: [bufr_compare options] bufr_compare_dir directory1 directory2 exit 1