From 2c02b59703616a46834f57df343c3d237327f59a Mon Sep 17 00:00:00 2001 From: axel Date: Mon, 23 Apr 2007 08:18:06 +1000 Subject: [PATCH] Replace the eval builtin with a function darcs-hash:20070422221806-ac50b-28cffc6c3063c14cd8ab30f999e3530314c78af2.gz --- builtin.c | 27 --------------------------- doc_src/eval.txt | 4 ++-- share/functions/eval.fish | 4 ++++ 3 files changed, 6 insertions(+), 29 deletions(-) create mode 100644 share/functions/eval.fish diff --git a/builtin.c b/builtin.c index 52f5c65a7..e54c25d11 100644 --- a/builtin.c +++ b/builtin.c @@ -2084,29 +2084,6 @@ static int builtin_status( wchar_t **argv ) } -/** - The eval builtin. Concatenates the arguments and calls eval on the - result. -*/ -static int builtin_eval( wchar_t **argv ) -{ - string_buffer_t sb; - int i; - int argc = builtin_count_args( argv ); - sb_init( &sb ); - - for( i=1; ieval [COMMANDS...] \subsection eval-description Description -The eval builtin causes fish to evaluate the specified parameters as a command. If more than one parameter is specified, all parameters will be joined using a space character as a separator. +The eval function causes fish to evaluate the specified parameters as a command. If more than one parameter is specified, all parameters will be joined using a space character as a separator. \subsection eval-example Example diff --git a/share/functions/eval.fish b/share/functions/eval.fish new file mode 100644 index 000000000..a8a8897da --- /dev/null +++ b/share/functions/eval.fish @@ -0,0 +1,4 @@ + +function eval -d "Evaluate parameters as a command" + echo -n $argv | . +end