home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.unix.aix
- Path: sparky!uunet!wupost!cs.utexas.edu!qt.cs.utexas.edu!yale.edu!ira.uka.de!Germany.EU.net!news.netmbx.de!uropax!sauveur!tom
- From: tom@sauveur.in-berlin.de (Th.H. v. Kamptz)
- Subject: Re: /etc/motd - any suggestions?
- Message-ID: <1993Jan8.183616.13956@sauveur.in-berlin.de>
- Organization: private
- References: <1993Jan4.024102.29058@ncsu.edu>
- Date: Fri, 8 Jan 1993 18:36:16 GMT
- Lines: 60
-
- In <1993Jan4.024102.29058@ncsu.edu> jmmannin@eos.ncsu.edu (James M Manning) writes:
-
-
- >The subject says it all!
- >Anybody know how to make nice looking letters out of ASCII
- >chars? Or anybody got anything cute?
- >Also, `date` doesn't work for showing the date.
- >Besides the anal way of putting a continuous crontab entry,
- >can that be done?
-
- You could do the following steps:
- 1.) Create /etc/motd as a named pipe with
- mknod /etc/motd p
- 2.) Write a daemon. It writes continuously your prefered motd into that pipe.
- Use for instance the following example...
-
- #include (what ever your system really needs...)
- main()
- {
- FILE *a,*b;
- char *string;
-
- string=(char *)malloc(64);
- while(1)
- {
- system("sleep 2"); /* or more if your system is slow */
- a = fopen("/etc/motd","w");
- fprintf(a,"\nThis is my motd, the Date follows\n");
- b = popen("/bin/date","r");
- fgets(string,60,b);
- pclose(b);
- fprintf(a,"%s\n",string);
- /* Here you could simple include any loging-feature to check who logs in,
- or who trys to read the motd, in the case of motd there is no reason,
- but there might be other files you want every Readaccess have logged */
- fclose(a);
- }
- }
-
- >Thanks for any info,
-
- It's a pleasure.
-
- >James Manning
-
- >P.S. Also, the mail and Net Ware printing problems are fixed,
- > thanks for all the help!
-
- Congratulations :-)
-
- TOM
- --
- ==============================================================================
- ! main(a){a="main(a){a=%c%s%c;printf(a,34,a,34);}";printf(a,34,a,34);} !
- ------------------------------------------,-----------------------------------
- ! root@sauveur.in-berlin.de ! Q: What is the best acceleration !
- ! tom@chamber.in-berlin.de ! for a NeXT ? !
- ! tomsoft@marie.physik.tu-berlin.de ! A: 9,81 m/s ! !
- =========================================='===================================
-
-