Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: ~ substitution
- X-seq: zsh-users 15699
- From: Guillaume Brunerie <guillaume.brunerie@xxxxxxxxx>
- To: sergio <mailbox@xxxxxxxxxxxxx>
- Subject: Re: ~ substitution
- Date: Sat, 8 Jan 2011 11:35:41 +0100
- Cc: zsh-users@xxxxxxx
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:mime-version:received:in-reply-to :references:from:date:message-id:subject:to:cc:content-type; bh=JzsBbrhaiw04s6GgLh53sZZri9jpFMEg8aaPrpKf6Go=; b=UO/WX3nj+mTSQGeD5llxjSibRpM/OP0pywAFtVOel3S1r0WHoxvf7xgOdbwR9dEbK2 MHTgCfEiXfBucgSvLTdxDU4uzvcRsp/bVK6IkVfZnZd0il093okT6x8CyqQ5IFEFzBHw ZQZOl2PgX4Vj2D+B4YG4auvFhRhAVp1khE0kw=
- Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type; b=ffM/SFTi/GKY/tAUP2eCOa89wEGJnPA6us1dGzaD5unAzKr7Jbfnz83+dKq8aBxguY 0GzZZ6HSohkhihn0WpUYJXRoDv9dm5HSdbAcD9cA3mSlzokKKkZ/npvgzFFEnmeJqhDr y9CvPLMjTAqxmqD4c4bN+H1Xtuxwcu8v5M3cQ=
- In-reply-to: <4D28316E.7060106@xxxxxxxxxxxxx>
- List-help: <mailto:zsh-users-help@zsh.org>
- List-id: Zsh Users List <zsh-users.zsh.org>
- List-post: <mailto:zsh-users@zsh.org>
- Mailing-list: contact zsh-users-help@xxxxxxx; run by ezmlm
- References: <4D28316E.7060106@xxxxxxxxxxxxx>
2011/1/8 sergio <mailbox@xxxxxxxxxxxxx>
> Hello.
>
> Is it possible, to control ~ substitution?
> When I type 'echo ~' I get '/home/sergio' --- all right.
> When I type 'echo a~b' I get 'a~b' --- all right.
> Also sh and bash do the same.
>
> But when I type 'echo h=~' (or h=~sergio, or h=~/some/path) I get 'h=~'.
> sh does the same, and bash will out 'h=/home/sergio'.
>
> How to control this? Why this may be bad? May be this is a bug?
>
Hi,
Try 'setopt magicequalsubst'.
man zshexpn:
[â]
FILENAME EXPANSION
Each word is checked to see if it begins with an unquoted `~'.
[â]
Notes
Filename expansion is performed on the right hand side of a parameter
assignment, including those appearing after commands of the typeset
family.
[â]
If the option MAGIC_EQUAL_SUBST is set, any unquoted shell argument in
the form `identifier=expression' becomes eligible for file expansion
as described in the previous paragraph. Quoting the first `=' also
inhibits this.
[â]
Guillaume
Messages sorted by:
Reverse Date,
Date,
Thread,
Author