Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: help with parameters
- X-seq: zsh-users 80
- From: Zefram <A.Main@xxxxxxxxxxxxxxxxx>
- To: paubert@xxxxxxxxxxxxxxx (Pierre.AUBERT)
- Subject: Re: help with parameters
- Date: Fri, 8 Sep 1995 15:46:43 +0100 (BST)
- Cc: zsh-users@xxxxxxxxxxxxxxx (Z Shell users mailing list)
- In-reply-to: <9509081251.AA26161@xxxxxxxxxxxxxxx> from "Pierre.AUBERT" at Sep 8, 95 02:51:44 pm
>hello,
>i don't understand why the following expression doesn't work
>
>> da="--date '1 September' +'%A'" ; date $da
>
>and this one works
>
>> date --date '1 September' +'%A'
The first one sets da to be a single string, and then passes it, as a
single argument, to date. The second one passes three separate
strings. A possible method that would work is
da=(--date '1 September' +'%A') ; date $da
which makes da an array of three strings, and passes it, as three
arguments, to date. Another possibility is
da="--date '1 September' +'%A'" ; eval date $da
which I think is closer to what you were trying to do. It makes da a
string as you did, then expands it on the eval command line. eval
reparses its arguments, interpreting the single quotes embedded in da.
-zefram
Messages sorted by:
Reverse Date,
Date,
Thread,
Author