Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: dumb question about parameter expansion
- X-seq: zsh-users 17322
- From: Jérémie Roquet <arkanosis@xxxxxxxxx>
- To: sergio <mailbox@xxxxxxxxxxxxx>
- Subject: Re: dumb question about parameter expansion
- Date: Thu, 11 Oct 2012 14:19:00 +0200
- Cc: zsh-users@xxxxxxx
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type:content-transfer-encoding; bh=iibmshaWKYeFFCWRD4VLHORRVIHyJj3KIzlswxtX25Y=; b=cGVFzk23jPo/3x9Sg8LTLmKyI+xNr/4yq3pWEauLoZWx/LkNo/FcvcnYoLY1mNyvxP +USMvt9HbAp4EHEMfEVTqEmJ1H1oNDzA5pfMIOUXj36qmrlsRDfi3D6aZmMSCK3t05UI pbGPSn23/jn+ZDuZtsykhQBJKA4YbOJhS71kbiS2e/US5O8a+VShKavO7y/qU75WVgVa NqwBEABbmpryNFUHqeLlnCWQFw9ZwZc7sYSsOy/ByEzfmg8zBoU6n5IfrFDebTnr6jEa tmCgL4ZzxF914x+uF6oBU8U4wGuurq2UKlXUDqw2Q6AHxqnfoa+fkDoluS3ylpPrc7U3 WhfA==
- In-reply-to: <5076B49A.90101@sergio.spb.ru>
- 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: <5076B49A.90101@sergio.spb.ru>
Hi Sergio,
2012/10/11 sergio <mailbox@xxxxxxxxxxxxx>:
> Looks like it's dumb question, but I can't understand this.
>
> % zsh -f
> % l='ls'
> % o='-l -h'
> % $l $o
> ls: invalid option -- ' '
> Try `ls --help' for more information.
>
> % ls -l -h
> total 512
> drwxr-x--- 2 sergio sergio ...
Unlike other shells, zsh doesn't split unquoted variables by default.
If you want that behaviour, you can either:
- “setopt shwordsplit” to have it by default, or
- use “$l $=o” to have it selectively (the “=” forces the split).
Best regards,
--
Jérémie
Messages sorted by:
Reverse Date,
Date,
Thread,
Author