well, there's `eval`, but it doesn't do what you want: it doesn't exec 
and if you gave it any arguments with $ in them, it would interpolate 
them again. `exec eval ...` gives "fish: Unknown command “eval”".  Why 
may not variables be used as commands?  Did the maker of this rule 
forget that it may be *necessary* for random access?  Hmm, `env $var` 
works, and so does `exec env $var`, but it seems like a total hack to 
me. (at the very least, the error message needs to tell you that's 
possible -- ideally perhaps the message would be different depending if 
the argument value was originally assigned to a constant versus an open 
expression like (dmenu_path | dmenu)).

-Isaac

Piotr Husiatyński wrote:
> hi,
> I'm just switching to fish from bash and rewriting my configuration files. One
> of the command is 
> 
>     var=$(dmenu_path | dmenu); exec $var
> 
> so I rewrite it to 
> 
>     set var (dmenu_path | dmenu); exec $var
> 
> but it returns me an error:
> 
>     ~> set var (dmenu_path | dmenu); exec $var
>     fish: Variables may not be used as commands. Instead, define a function 
>     like 'function var; xterm $argv; end'. See the help section for the
>     function command by typing 'help function'.
> 
> 
> 


-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php
_______________________________________________
Fish-users mailing list
Fish-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/fish-users

Reply via email to