* Quoting strings
@ 2011-02-02 3:30 Anonymous bin Ich
2011-02-02 9:30 ` Jérémie Roquet
0 siblings, 1 reply; 2+ messages in thread
From: Anonymous bin Ich @ 2011-02-02 3:30 UTC (permalink / raw)
To: zsh-users
Hi!
I have a string1='ls'
and string2='-l | cut -d " " -f6'
Now I create a new string3="$string1 $string2"
It all looks fine but when I try to run it via $($string3) I get:
+./working.zsh:7> '/bin/ls -l |cut -d " " -f6'
./working.zsh:7: no such file or directory: /bin/ls -l |cut -d " " -f6
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: Quoting strings
2011-02-02 3:30 Quoting strings Anonymous bin Ich
@ 2011-02-02 9:30 ` Jérémie Roquet
0 siblings, 0 replies; 2+ messages in thread
From: Jérémie Roquet @ 2011-02-02 9:30 UTC (permalink / raw)
To: Zsh Users; +Cc: Anonymous bin Ich
Hi,
2011/2/2 Anonymous bin Ich <ichbinanon@gmail.com>:
> I have a string1='ls'
> and string2='-l | cut -d " " -f6'
>
> Now I create a new string3="$string1 $string2"
>
> It all looks fine but when I try to run it via $($string3) I get:
>
> +./working.zsh:7> '/bin/ls -l |cut -d " " -f6'
> ./working.zsh:7: no such file or directory: /bin/ls -l |cut -d " " -f6
You are looking for the `eval' builtin:
$ eval $string3
Best regards,
--
Jérémie
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2011-02-02 9:30 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-02-02 3:30 Quoting strings Anonymous bin Ich
2011-02-02 9:30 ` Jérémie Roquet
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).