Skip to content

Instantly share code, notes, and snippets.

@eiro
Created May 12, 2017 17:43
Show Gist options
  • Save eiro/8484f9eba54f96ce092f81efc446c3d7 to your computer and use it in GitHub Desktop.
Save eiro/8484f9eba54f96ce092f81efc446c3d7 to your computer and use it in GitHub Desktop.
weird mksh local array ?
# i use MIRBSD KSH R54 2016/11/11
# i don't understand why if i uncomment this line
# set -u
# i get this message
# outch.ksh[21]: _m4a[@]: parameter not set
# as it seems _m4 works
_mma () {
local _m4 _m4a _key _value
_m4a=( "$@" )
_m4=( )
for _key in $import; do
nameref _value=$_key
_m4+=( "-D$_key=$_value" )
done
m4 "${_m4[@]}" "${_m4a[@]}"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment