home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #1 / NN_1993_1.iso / spool / comp / unix / aix / 13158 < prev    next >
Encoding:
Text File  |  1993-01-08  |  2.3 KB  |  71 lines

  1. Newsgroups: comp.unix.aix
  2. 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
  3. From: tom@sauveur.in-berlin.de (Th.H. v. Kamptz)
  4. Subject: Re: /etc/motd - any suggestions?
  5. Message-ID: <1993Jan8.183616.13956@sauveur.in-berlin.de>
  6. Organization: private
  7. References: <1993Jan4.024102.29058@ncsu.edu>
  8. Date: Fri, 8 Jan 1993 18:36:16 GMT
  9. Lines: 60
  10.  
  11. In <1993Jan4.024102.29058@ncsu.edu> jmmannin@eos.ncsu.edu (James M Manning) writes:
  12.  
  13.  
  14. >The subject says it all!
  15. >Anybody know how to make nice looking letters out of ASCII
  16. >chars?  Or anybody got anything cute?
  17. >Also, `date` doesn't work for showing the date.
  18. >Besides the anal way of putting a continuous crontab entry,
  19. >can that be done?
  20.  
  21. You could do the following steps:
  22. 1.) Create /etc/motd as a named pipe with
  23.              mknod /etc/motd p
  24. 2.) Write a daemon. It writes continuously your prefered motd into that pipe.
  25.   Use for instance the following example...
  26.  
  27. #include (what ever your system really needs...)
  28. main()
  29. {
  30.    FILE *a,*b;
  31.    char *string;
  32.  
  33.    string=(char *)malloc(64);
  34.    while(1)
  35.    {
  36.       system("sleep 2"); /* or more if your system is slow */
  37.       a = fopen("/etc/motd","w");
  38.       fprintf(a,"\nThis is my motd, the Date follows\n");
  39.       b = popen("/bin/date","r");
  40.       fgets(string,60,b);
  41.       pclose(b);
  42.       fprintf(a,"%s\n",string);
  43. /* Here you could simple include any loging-feature to check who logs in,
  44.    or who trys to read the motd, in the case of motd there is no reason,
  45.    but there might be other files you want every Readaccess have logged */
  46.       fclose(a);
  47.    }
  48. }
  49.  
  50. >Thanks for any info,
  51.  
  52. It's a pleasure.
  53.  
  54. >James Manning
  55.  
  56. >P.S. Also, the mail and Net Ware printing problems are fixed,
  57. >     thanks for all the help!
  58.  
  59. Congratulations :-)
  60.  
  61. TOM
  62. -- 
  63. ==============================================================================
  64. !    main(a){a="main(a){a=%c%s%c;printf(a,34,a,34);}";printf(a,34,a,34);}    !
  65. ------------------------------------------,-----------------------------------
  66. ! root@sauveur.in-berlin.de               ! Q: What is the best acceleration !
  67. ! tom@chamber.in-berlin.de                !    for a NeXT ?                  !
  68. ! tomsoft@marie.physik.tu-berlin.de       ! A: 9,81 m/s !                    !
  69. =========================================='===================================
  70.  
  71.