I\'m using PuTTY to remotely log onto my school\'s host. Upon logging in, we are required to do these steps:
Figured this out with the help of a friend. The -m PuTTY option will end your session immediately after it executes the shell file. What I've done instead is I've created a batch script called putty.bat with these contents on my Windows machine:
@echo off
putty -load "host" -l username -pw password
This logs me in remotely to the Linux host. On the host side, I created a shell file called sql with these contents:
#!/bin/tcsh
add oracle10g
sqlplus username password
My host's Linux build used tcsh. Other Linux builds might use bash, so simply replace tcsh with bash and you should be fine.
To summarize, automating these steps are now done in two easy steps:
putty.bat. This opens PuTTY and logs me into the host.tcsh sql. This adds the oracle tool to my host, and logs me into the sql database.