starting a background process



Hi,

I would like to know how to spawn a back process in Expect/TCL. A piece
of code would be helpful....

I have a script which logs into remote system and does serious of
operation and bring out the output. find below the simple script for
reference...

#!/usr/bin/expect -f
set prompt "(%|#|\\$|%]|\\):|>) $"
spawn ssh kimi@xxxxxxxxxxx
expect {
password {
send_user "Enter password for $cStruct(admin):"
stty -echo
expect_user -re "(.*)\n" {set pStruct(passwd)
$expect_out(buffer)}
send "$pStruct(passwd)\r"
stty echo
}
-re $prompt {
send_user "Please wait the operation is being performed"
log_user 0
send "somecommand\r"
expect -re $prompt
send "somecommand\r"
expect -re $prompt
send "somecommand\r"
expect -re $prompt
send "somecommand\r"
expect -re $prompt
send "somecommand\r"
expect -re $prompt
send "somecommand\r"
expect -re $prompt
set result $expect_out(buffer)
puts stdout $result
send "exit\r"
}
}


In the above operation, after user enters the password he will get the
message "please wait the operation is being performed" and then because
of log_user 0 user wont get to see what command is fired and after some
time he will get the result.

My requirement is to display "please wait while the operation is being
performed" to be dynamic and hence keeps blinking till the operation is
complete.

Any help would be apprecited.

Thanks in advance
Kimi

.



Relevant Pages

  • behavioral change of "read" builtin for sh on 8-CURRENT
    ... This script waits for terminal input for each of the above variables (INT, ... On 8-CURRENT if I hit Enter with no input at the prompt the system seems to ... recognize the newline as input and continues to sit there until I hit Enter ... Enter network interface: ...
    (freebsd-current)
  • behavioral change of "read" builtin for sh on 8-CURRENT
    ... This script waits for terminal input for each of the above variables (INT, ... On 8-CURRENT if I hit Enter with no input at the prompt the system seems to ... recognize the newline as input and continues to sit there until I hit Enter ... Enter network interface: ...
    (freebsd-questions)
  • Re: behavioral change of "read" builtin for sh on 8-CURRENT
    ... This script waits for terminal input for each of the above variables (INT, ... On 8-CURRENT if I hit Enter with no input at the prompt the system seems to ... recognize the newline as input and continues to sit there until I hit Enter ... Enter network interface: ...
    (freebsd-current)
  • Re: behavioral change of "read" builtin for sh on 8-CURRENT
    ... This script waits for terminal input for each of the above variables (INT, ... On 8-CURRENT if I hit Enter with no input at the prompt the system seems to ... recognize the newline as input and continues to sit there until I hit Enter ... Enter network interface: ...
    (freebsd-questions)
  • RE: Internet explorer will not update
    ... Connections>> Double click Internet Options, ... Automatic prompting for ActiveX controls ... Prompt ... Initialize and script ActiveX controls not marked as Safe ...
    (microsoft.public.windowsxp.general)