Views |
||||||||||||||
How do I email (or do something else) with the notifications, such as the savegroup completion notice, or the bootstrap report?
Examples of programs that do not accept input at STDIN are ls and dir. To find out if a command accepts input at STDIN, run it like this: echo hey |command If you were on a UNIX box, and entered "mail root" as the command above, it would send a mail to root with the body of "hey." If you were on an NT box (and had blat installed), and entered "blat - root@machine," it would send a mail to root@machine with the body of "hey." (The first "-" tells blat to look at STDIN for its data.). These commands accept data on STDIN. However, if you entered "dir" as the command above, you would see that the word "hey" does not show up in the output -- only the results of the dir show up. This means that dir does not accept data on STDIN. What you put in the notification window always starts with a '|' (pipe) symbol, and is followed by a command that accepts data on STDIN. This means that you cannot append things after a ";" character. For example, if the existing notificatation entry is something like this: |mailx -s "Savegroup Completion Notice" root You cannot append something to it like this: |mailx -s "Savegroup Completion Notice" root; lp -d myprinter What many people do is to create a script that accepts input from STDIN, and then processes the information in whatever way you want. On UNIX , you can do this with the bourne or korn shells easily. The line below will take whatever appears at STDIN and send it to the file /tmp/$$.report. cat >/tmp/$$.report If you are on NT, you can use perl to do this. (Of course, you can use perl on UNIX, too!) The following line will read whatever is at STDIN and assign it to the variable $report: $report=<STDIN> |
||||||||||||||
| This page was last modified 08:26, 2 December 2006. | ||||||||||||||