summaryrefslogtreecommitdiff
path: root/client/echo.c
diff options
context:
space:
mode:
authormsvensson@neptunus.(none) <>2007-02-16 15:19:38 +0100
committermsvensson@neptunus.(none) <>2007-02-16 15:19:38 +0100
commit8931166e559638d3f24b8e915805226087e6d281 (patch)
treefc724091b55b15d153b7c8e6b6c198501b0f89e9 /client/echo.c
parent68158c982d379a2a7d8dde72ad84cc790f0b63cf (diff)
downloadmariadb-git-8931166e559638d3f24b8e915805226087e6d281.tar.gz
Workaround for problem where cygwin's bash/sh randomly fails with error 128 which
mainly occurs on win2003 64bit. - Execute "exec" commands directly with cmd.exe and replace "--exec echo ..." with "--exec .\echo.exe ..."
Diffstat (limited to 'client/echo.c')
-rw-r--r--client/echo.c45
1 files changed, 45 insertions, 0 deletions
diff --git a/client/echo.c b/client/echo.c
new file mode 100644
index 00000000000..4483eaad293
--- /dev/null
+++ b/client/echo.c
@@ -0,0 +1,45 @@
+/* Copyright (C) 2000 MySQL AB
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+
+/*
+ echo is a replacement for the "echo" command builtin to cmd.exe
+ on Windows, to get a Unix eqvivalent behaviour when running commands
+ like:
+ $> echo "hello" | mysql
+
+ The windows "echo" would have sent "hello" to mysql while
+ Unix echo will send hello without the enclosing hyphens
+
+ This is a very advanced high tech program so take care when
+ you change it and remember to valgrind it before production
+ use.
+
+*/
+
+#include <stdio.h>
+
+int main(int argc, char **argv)
+{
+ int i;
+ for (i= 1; i < argc; i++)
+ {
+ fprintf(stdout, "%s", argv[i]);
+ if (i < argc - 1)
+ fprintf(stdout, " ");
+ }
+ fprintf(stdout, "\n");
+ return 0;
+}