On Fri, Jun 6, 2008 at 7:51 PM, Martin Bähr <[EMAIL PROTECTED]> wrote: > On Fri, Jun 06, 2008 at 07:08:26PM -0400, Philip Ganchev wrote: >> On Fri, Jun 6, 2008 at 12:50 AM, Martin Bähr >> <[EMAIL PROTECTED]> wrote: >> > On Thu, Jun 05, 2008 at 05:54:05PM -0400, Philip Ganchev wrote: >> >> On 6/2/08, Piotr Husiatyński <[EMAIL PROTECTED]> wrote: >> >> > var=$(dmenu_path | dmenu); exec $var >> >> function temp_func; dmenu_path | dmenu; end >> >> temp_func >> > in this example it may not matter, but in other cases it can make a >> > difference if running the command has sideeffects or changes the result. >> Not sure what you mean. > > var=$(dmenu_path | dmenu); first executes dmenu_path, and if that fails > it runs dmenu. the output is saved and stored in $var. $var may be > reused many times. > > temp_func would execute dmenu_path every time it is called. > > (and now that i look at it, it doesn't even do what is expected here, > namely take the string that dmenu_path dmenu print, and run that as a > command.)
You are right, my bad. The content of "var" is created when you run "dmenu_path | dmenu", but can be executed at another time. Maybe something like this would work: dmenu_path | dmenu > dmenu_file . dmenu_file And what is wrong with using "eval $var" here?? set var (dmenu_path | dmenu); eval $var ------------------------------------------------------------------------- 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 [email protected] https://lists.sourceforge.net/lists/listinfo/fish-users
