* help with parameters
@ 1995-09-08 12:51 Pierre.AUBERT
1995-09-08 14:46 ` Zefram
0 siblings, 1 reply; 2+ messages in thread
From: Pierre.AUBERT @ 1995-09-08 12:51 UTC (permalink / raw)
To: zsh-users
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'
Ciao Pierre
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: help with parameters
1995-09-08 12:51 help with parameters Pierre.AUBERT
@ 1995-09-08 14:46 ` Zefram
0 siblings, 0 replies; 2+ messages in thread
From: Zefram @ 1995-09-08 14:46 UTC (permalink / raw)
To: Pierre.AUBERT; +Cc: Z Shell users mailing list
>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
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~1995-09-08 14:53 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1995-09-08 12:51 help with parameters Pierre.AUBERT
1995-09-08 14:46 ` Zefram
Code repositories for project(s) associated with this public inbox
https://git.vuxu.org/mirror/zsh/
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).