bug-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: mapfile associative array shim Was: Re: [feature request] add associ


From: Léa Gris
Subject: Re: mapfile associative array shim Was: Re: [feature request] add associative array support to mapfile
Date: Thu, 17 Dec 2020 16:51:25 +0100
User-agent: Telnet/1.0 [tlh] (PDP11/DEC)

Shorty shim:

! { mapfile -A _</dev/null;} 2>/dev/null&&{ mapfile(){ local k v d=$'\n';local -n A=${*: -1:1};[ ${*: -2:1} = -A ]&&{ [ ${*:1:1} = -d ]&&d=${*:2:1};while read -rd "$d" k v||[[ -n $k && -n $v ]];do A[$k]=$v;done;:;}||command mapfile "$@";};}

--
Léa Gris




reply via email to

[Prev in Thread] Current Thread [Next in Thread]