Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: Confused about splitting



Daniel Shahaf <d.s@xxxxxxxxxxxxxxxxxx> writes:

>      1	% () {
>      2	    : ${1:=enp2s0}
>      3	    local -a net_dev_lines=( "${(@f)"$(</proc/net/dev)"}" )
>      4	    local line=${${(M)net_dev_lines:#*$1*}[1]}
>      5	    print -r -- $=line
>      6	    print -r -- ${#${=line}}
>      7	  }
>      8	17
>      9	% 

Thanks but that's mostly the kind of syntax I wish to avoid.



Messages sorted by: Reverse Date, Date, Thread, Author