compatibilité avec les vieilles versions de bash

This commit is contained in:
Jephté Clain 2017-07-17 16:15:30 +04:00
parent 04717850a5
commit 335ca05aaa
1 changed files with 3 additions and 2 deletions

View File

@ -3516,7 +3516,7 @@ function ask_any() {
lf="$(strlower "$f")"
[ "$r" == "$lf" ] && return $i
if [ -z "$defi" ]; then
[[ "$f" =~ [A-Z] ]] && defi="$i"
[ -z "${f/[A-Z]/}" ] && defi="$i"
fi
if [ "$lf" == o ]; then
case "$r" in o|y|1|v|t) return $i;; esac
@ -3530,7 +3530,8 @@ function ask_any() {
else
i=0
while [ $i -lt $count ]; do
[[ "${format:$i:1}" =~ [A-Z] ]] && return $i
f="${format:$i:1}"
[ -z "${f/[A-Z]/}" ] && return $i
i=$(($i + 1))
done
return 0