Uwe Klein wrote:
> Kimi wrote:
> redirection up to a label ( here: EOF) is a shell feature
>
> Hi,
> you have complete scripts for what you want to do?
> ssh to the local host! i.e.
> set host localhost
> instead of
> set host remotehost
> spawn ssh ${user}...$host
> ..
> or
> spawn a shell on your local machine
> spawn sh
> ...
>
>
> uweHi,
Thanks for the info, the script is huge one... what i have put here is
a piece of code for sql login...
sqlString, storeQuery(1), storeQuery(2), are proper queries...
set sqlString "$dbUserId/$dbpaswd...$dbTnsId\n"
send "sqlplus -s << EOF\r"
expect -re $prompt
send "$sqlString\r"
expect -re $prompt
send "whenever sqlerror exit sql.sqlcode rollback;\r"
expect -re $prompt
send "set feedback off \r"
expect -re $prompt
send "$storeQuery(1)\r"
expect -re $prompt
send "$storeQuery(2)\r"
expect -re $prompt
send "$storeQuery(3)\r"
expect -re $prompt
send "$storeQuery(4)\r"
expect -re $prompt
send "/\r"
expect -re $prompt
send "EOF\r"
expect -re $prompt
set pStruct(DbOutput) $expect_out(buffer)
The above code works well, when i login to remote machine using ssh (
using expect ) and send these commands to remote terminal... But What i
wanted was to execute the above operation from mylocal system without
loggin to remote machine...
ssh to local machine solves the issue, but it will prompt for password
which should not happen ideally...
Please let me know If it is possible to do serious of command execution
in local machine like what we do when we login to remote machine?
can i use spawn sqlplus -s << EOF'? Acutally i am not able to use
like that...
Thanks in advance
Kimi
kimi
| Sat, 10 May 2008 01:10:00 GMT |