From c9412e395de0b34456fc6bf78146575f66c02976 Mon Sep 17 00:00:00 2001 From: Richard Soderberg Date: Mon, 21 Sep 2015 12:51:18 -0700 Subject: [PATCH] workaround bash 4.2- not having unset A[-1] support --- cipherscan | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/cipherscan b/cipherscan index b7d0d1a..13fa067 100755 --- a/cipherscan +++ b/cipherscan @@ -1915,8 +1915,9 @@ if (( $# < 1 )); then fi PARAMS=("$@") -TARGET=${PARAMS[-1]} -unset PARAMS[-1] +last_element="$(( $# - 1 ))" +TARGET=${PARAMS[$last_element]} +unset PARAMS[$last_element] # Refuse to proceed if the hostname starts with a hyphen, since hostnames can't # begin with a hyphen and this likely means we accidentally parsed an option as