Reputation: 91
I am in badly need of some direction here :) ,there is an batch file(.bat) which runs an teredata query on windows, but for some reasons i will have to use Linux server from now on
test.bat
echo off
bteq < D:\commands.txt > D:\output.txt 2>&1
@echo off goto end
:end @echo exit
commands.txt
.LOGON ------
select (date);
.LOGOFF
how can i do this on red hat - linux? and is it necessary to have bteq utilities or any other Teredata utilities , i have got teredata ODBC drivers on linux though. it would be great if any one could give an insight onto this ?
Thank you
Upvotes: 1
Views: 1240
Reputation: 60462
BTEQ is available on multiple flavours of Windows/Unix/linux including RedHat.
BTEQ can't use ODBC, need to install it plus some other packages like cli.
You just might have to do some minor modifications in your BTEQ script, e.g. backslash to slash in pathname, rm instead of del in .OS.
Otherwise you can run this as a shell script (you just have to decide which Unix shell to use: sh, ksh, bash, etc.), all you can do in a Windows bat can be done in Unix shel, too.
Make the script executable using chmod u+x test.sh
#!/bin/sh
bteq < /...../commands.txt > /...../output.txt 2>&1
and then simply run it from the command prompt.
Upvotes: 1