Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: aliases not getting expanded inside functions?
- X-seq: zsh-users 5698
- From: Carlos Carvalho <carlos@xxxxxxxxxxxxxx>
- To: zsh-users@xxxxxxxxxx
- Subject: Re: aliases not getting expanded inside functions?
- Date: Mon, 13 Jan 2003 19:40:18 -0200
- In-reply-to: <1030113184827.ZM21872@xxxxxxxxxxxxxxxxxxxxxxx>
- Mailing-list: contact zsh-users-help@xxxxxxxxxx; run by ezmlm
- References: <15893.44217.393956.262362@xxxxxxxxxxxxxx> <20030103164552.A28966@xxxxxxxxxxx> <15893.50996.646711.184945@xxxxxxxxxxxxxx> <20030103184455.A5692@xxxxxxxxxxx> <15893.53780.524763.695176@xxxxxxxxxxxxxx> <20030103185407.GA11836@xxxxxxxx> <15897.15986.562636.628562@xxxxxxxxxxxxxx> <1030106125404.ZM4660@xxxxxxxxxxxxxxxxxxxxxxx> <15903.36155.716460.639226@xxxxxxxxxxxxxx> <1030111184020.ZM11764@xxxxxxxxxxxxxxxxxxxxxxx> <15906.65149.206767.381472@xxxxxxxxxxxxxx> <1030113184827.ZM21872@xxxxxxxxxxxxxxxxxxxxxxx>
Bart Schaefer (schaefer@xxxxxxxxxxxxxxxx) wrote on 13 January 2003 18:48:
>On Jan 13, 3:59pm, Carlos Carvalho wrote:
>}
>} > fields=( "${(@s:;:)dataline}" ) # Answers your other question
>}
>} Doesn't work for me:
>
>Hrm. I was sure I'd tried it, but on your input I get the same result
>you do. Well, there's always:
>
> IFS=';' eval 'fields=( $=dataline )'
Good, and it also works without the eval:
IFS=';' fields=( $=dataline )
did it for me.
>However, it occurs to me that with dataline='...;";";...' -- that is, a
>quoted semicolon in the input data -- there's no quick solution that's
>going to do exactly what you need.
Yes, I know. The only way to deal with this is to parse the line
character by character. I'm taking the risk.
>So don't name the array "fields", name it "f" or some such. Three extra
>characters (e.g. $f[capital] instead of $capital) for a whole lot less
>complexity elsewhere. And quote removal may be as easy as:
>
> f=( ${${(kv)f#\"}%\"} )
>
>(Whether it's actually that easy depends on your input data, e.g., you
>might also need to convert \" to ", but I think `read' will have done
>that for you already.)
Quite persuasive :-) (I hope this is still English)
Messages sorted by:
Reverse Date,
Date,
Thread,
Author