Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: can I access output of locate?
- X-seq: zsh-users 20006
- From: ZyX <kp-pav@xxxxxxxxx>
- To: zzapper <david@xxxxxxxxxxxxxx>, "zsh-users@xxxxxxx" <zsh-users@xxxxxxx>
- Subject: Re: can I access output of locate?
- Date: Fri, 13 Mar 2015 22:01:39 +0300
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex.ru; s=mail; t=1426273300; bh=M59fUUAedmORHYvwLU7fhXVYlh3I2PwFHaj+bDEli2Q=; h=From:To:In-Reply-To:References:Subject:Date; b=adfKZdfliTAQRs7es1qdrgzSNIFw9lV6M19NMn3sV2roTUZYID/OtiD41wMQwsmmW 6V/vl82xLc8CeY87m5R2RSk5sN5/xOGuFrU151vwAIX68bEMJYCUekWoDmCqUm3mEC Pk1hK9LZqWqpbFpM10JQ0E9TybxvTjQIhegcXQ7g=
- In-reply-to: <XnsA45CAFF753C5Fdavidrayninfocouk@80.91.229.13>
- 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: <XnsA45CA6B27FC84davidrayninfocouk@80.91.229.13> <XnsA45CAAA012255davidrayninfocouk@80.91.229.13> <55031519.9020906@mailoo.org> <XnsA45CAFF753C5Fdavidrayninfocouk@80.91.229.13>
13.03.2015, 20:19, "zzapper" <david@xxxxxxxxxxxxxx>:
> Edelwin Khaelos <edelwin@xxxxxxxxxx> wrote in news:55031519.9020906
> @mailoo.org:
> variables
>
> # then to answer my own question
> a=($(locate my.cnf)) # the outer () are important
Now locate something with a space. This variant works only as long as you are certain you have no characters from IFS in a file name.
Thus you should use a=( ${(0)"$(locate -0 my.cnf)"} ).
>
> echo ${a[1]}
>
> --
> zzapper
> https://twitter.com/dailyzshtip
>
> ---
> This email has been checked for viruses by Avast antivirus software.
> http://www.avast.com
Messages sorted by:
Reverse Date,
Date,
Thread,
Author