cunning.

i have never used ENVIRON, using -v instead but this can cause escaping 
problems. this is a nice solution.

-Steve


> On 17 Aug 2018, at 09:27, dexen deVries <[email protected]> wrote:
> 
> mental note, as it took me a second to put it together:
> 
> #!/usr/bin/env rc
> 
> flag e +
> 
> myList = ( aa bb cc)
> 
> awk '
>       BEGIN {
>               split(ENVIRON["myList"], myList, "\001")        # "\000" on 
> plan9 proper
>               for (n in myList)
>                       print n, myList[n]
>       }
> '
> 


Reply via email to