map(explode)|transpose|map(map(values)[])|implode
说明
# example input: ["LYES","APRONS"]
map(explode) # make list of ordinals [[76,89,69,83],[65,80,82,79,78,83]]
| transpose # zip lists [[76,65],[89,80],[69,82],[83,79],[null,78],[null,83]]
| map(map(values)[]) # rm nulls and flatten [76,65,89,80,69,82,83,79,78,83]
| implode # convert back to string "LAYPERSONS"
样品运行
$ paste input <(jq -Mrc 'map(explode)|transpose|map(map(values)[])|implode' input)
["SIMPLE"] SIMPLE
["POLLS","EPEES"] PEOPLELESS
["LYES","APRONS"] LAYPERSONS
["ABCDE", "a c", "123 567"] Aa1B 2Cc3D E567
["\"\\n$?*", "", ",(.)\" "] ",\(n.$)?"*
$ echo -n 'map(explode)|transpose|map(map(values)[])|implode' | wc -c
49
在线尝试