Open WhyIsEvery4thYearAlwaysBad opened 2 years ago
well, if I'm not mistaken, it's really not much to change as most of the code is sed and awk. Just replace
function parse_yaml {
local prefix=$2
local separator=${3:-_}
local s='[[:space:]]*' w='[a-zA-Z0-9_]*' fs=${fs:-$(echo @|tr @ '\034')} i=${i:- }
by
parse_yaml () {
prefix=$2
separator=${3:-_}
s='[[:space:]]*' w='[a-zA-Z0-9_]*' fs=${fs:-$(echo @|tr @ '\034')} i=${i:- }
i.e. drop the keywords function
and local
. Could you give it a try?
bash
is not a portable shell, unlikesh
, so it'd be nice if the script could run on just the bourne shell.