# Some other error? if result=2 goto errorĮxample.sh -– # NAME : Example.sh # This file is executed in unix by TeraTerm macro language # Everything cool? if result=1 goto todo_bien Wait #10’MY END-OF-PROCESS USER-DEFINED MESSAGE’ #10’MY USER-DEFINED ERROR MESSAGE’
# Establish user # UsernamePrompt = ‘login:’ Username = ‘Yeah’ PasswordPrompt = ‘password:’ Password = ‘right’ Mark Raul Beristain Maldonado via oracle-db-l wrote: Visit DB Knowledge Base- Įxample.ttl - # NAME : Example.ttl # This file is executed from the DOS bat file. Make sure there is a carraige return after the exit command in the sql script. Notes: The dos.bat file uses double quotes around long file name variables. echo schema User to log in as echo schema_password Password echo Optional Oracle connect string, must echo contain signĬleartab.sql: truncate table fred / exit sql file: dos.bat: off REM Constant declarations set SQL_FILE=cleartab.sql set SQL_DIR=D:scriptssql set SQL_LOG=”D:scriptslogdos_bat_output.log” if “%1%” = “” goto usage if “%2%” = “” goto usage if exist %SQL_LOG% del %SQL_LOG% sqlplus %1/%2%3 >%SQL_LOG% :usage echo Usage: DOS_BAT schema password echo.
If you have Oracle client software (SQL*Plus and SQL*Net) installed on the DOS machine, you could use a batch file and. = It > runs the bat from DOS to start TeraTerm which in turn logs into some = unix > machine to run commands from sqlplus. > -–Mensaje original-– > De: Raul Beristain Maldonado via oracle-db-l > Enviado el: Viernes 5 de Abril de 2002 11:29 > Para: Raul Beristain Maldonado > Asunto: RE: Script help needed >=20 > Visit DB Knowledge Base- >=20 > I use tera term (which is freeware, > ) to run this. Sqlplus -s “MY END-OF-PROCESS USER-DEFINED MESSAGE (For TeraTerm to use)” # :todo_bien messagebox ‘Everything is proceeding as I have forseen.’ ‘Status’ closettĮxample.sh -– # NAME : Example.sh # This file is executed in unix by TeraTerm macro language
Stop macro :error yesnobox ‘Want to see log file?’ ‘ERROR’ if result then sendln ‘cd $HOME/files/log’ sendln ‘more MyErrLog.log’ endif end # Some other error? if result=3D2 goto error # Everything cool? if result=3D1 goto todo_bien Wait #10’MY END-OF-PROCESS USER-DEFINED MESSAGE’ #10’MY USER-DEFINED = ERROR MESSAGE’ # Both EOP and Error messages should be defined # within the shell script. Should this message do not come up # (as in the event of an error), warn user. # Wait until End of Process message appears and then # close TeraTerm. # Here is where you execute the shell # sendln ‘cd $HOME/files/ksh’ sendln ‘MiScript.sh’ # Login # wait UsernamePrompt sendln Username
# Establish user # UsernamePrompt =3D ‘login:’ Username =3D ‘Yeah’ PasswordPrompt =3D ‘password:’ Password =3D ‘right’ # Open TeraTerm # connect ‘your.ip.goes.here’ Here goes:Įxample.bat - off d: cd d:progstera ttpmacro Example.ttl exitĮxample.ttl - # NAME : Example.ttl # This file is executed from the DOS bat file.