Re: [tkined] nothing seems to work for email sending in nt scotty script

Jaques, Bob (saustin_deja@my-deja.com)
Mon, 06 Dec 1999 05:48:09 -0800


>
>i tried
>exec echo "hi"
>echo "hi"

There is no such command as echo in NT. The command interpreter/batch file processor does have an echo command, however - so if you're running tclsh or wish just plain "echo hi" ought to work, since tcl will pass it through to the next level of command interpreter. "exec echo" won't work because there's no executable called echo.exe.

>
>it fails I never reach the message page sent.
>
>if i remove a line line echo "hi" i do reach page sent
>
>1. how can I get a log of the failure the monitor job simply dies

Not exactly sure what you're asking here, but there is a logging facility in NT something like unix syslog. Use the "Event Viewer" program (eventvwr.exe) to view the event log for system, security and application log messages. Don't know if Tcl has a well-defined interface to write messages in this log?

>
>2. what is the syntex to get a command line to work in NT
If you just issue an NT command as a Tcl command, when the Tcl command interpreter doesn't recognize it, it will pass it on to the NT command interpreter. If the command is either built-in to the interpreter (cmd.exe) or represents an executable in the PATH, the command should execute. You can also use the exec Tcl command to force the command to execute in the NT command environment, however the command must be an executable file. So if you want to exec an NT command that's part of the interpreter (like echo, dir, or such), then you have to exec the interpreter. This behaviour is a bit flaky depending on your version of Tcl and whether you're running tclsh or wish. For example:

echo hi
(tclsh80 and wish80 both display "hi")

set hi hello
echo $hi
(tclsh80 and wish80 both display "hello")

exec cmd /e "echo hi"
(tclsh80 hangs, wish80 shows the NT command prompt but doesn't echo anything, then returns, obviously the wrong behaviour in either case.)

So you may have to play around with the different syntax until you either get the desired result or realize the feature you want simply doesn't work in the version of Tcl you have.

>
>here is the code fragment its from library.tcl
>
>
>}
> if {[lsearch $action email] >= 0} {
> writeln "page pending"
> c:\smail\mail -s "SA" -f w.w jaques @mail.com <mailto:somemail@mail.com>
> writeln "[clock format [clock seconds]]:"
> writeln "page sent"
> writeln
> }
Don't know about writeln (other than from Pascal!) so that must be implemented in some library. I also don't have "smail" installed, if you let me know where I can get it I will run a quick test on my NT setup.

Hope this helps
S. Austin

--== Sent via Deja.com http://www.deja.com/ ==--
Share what you know. Learn what you don't.

--
!! This message is brought to you via the `tkined & scotty' mailing list.
!! Please do not reply to this message to unsubscribe. To subscribe or
!! unsubscribe, send a mail message to <tkined-request@ibr.cs.tu-bs.de>.
!! See http://wwwsnmp.cs.utwente.nl/~schoenw/scotty/ for more information.