Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: Quoting strings



Hi,

2011/2/2 Anonymous bin Ich <ichbinanon@xxxxxxxxx>:
> 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



Messages sorted by: Reverse Date, Date, Thread, Author