home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #31 / NN_1992_31.iso / spool / comp / unix / ultrix / 9059 < prev    next >
Encoding:
Text File  |  1992-12-23  |  1.5 KB  |  43 lines

  1. Newsgroups: comp.unix.ultrix
  2. Path: sparky!uunet!gatech!usenet.ins.cwru.edu!agate!doc.ic.ac.uk!cc.ic.ac.uk!imperial.ac.uk!vulture
  3. From: vulture@imperial.ac.uk (Thomas Sippel - Dau)
  4. Subject: Re: Access to aliases ????
  5. Message-ID: <1992Dec23.120423.20688@cc.ic.ac.uk>
  6. Sender: vulture@carrion.cc.ic.ac.uk (Thomas Sippel - Dau)
  7. Nntp-Posting-Host: cscgc
  8. Reply-To: cmaae47@imperial.ac.uk
  9. Organization: Imperial College of Science, Technology and Medicine
  10. References: <989@rc1.vub.ac.be>
  11. Date: Wed, 23 Dec 92 12:04:22 GMT
  12. Lines: 29
  13.  
  14. In article <989@rc1.vub.ac.be>, jcu@dec5.ulb.ac.be (Jean-Christophe Ury) writes:
  15. - It may seems stupid but I ask you anyway,
  16. - I use ULTRIX V4.3.
  17. - I 've  some aliases defined in my shell.I would access these aliases via
  18. - a C program. Is it possible.
  19.  
  20. It is easy, but you won't like the answer:
  21.  
  22. 1.) read the .cshrc file (fraught woth problems), or 
  23.  
  24. 2.) execute (from C) something like
  25.  
  26.     system ("csh -c alias >/tmp/myaliases");
  27.  
  28. and read the resulting file.
  29.  
  30. This will not access those that you have typed into the current shell,
  31. but is otherwise a lot easier, since you don't have to parse the ifs
  32. and buts of csh syntax.
  33.  
  34.                                 Thomas
  35. -- 
  36. *** This is the operative statement, all previous statements are inoperative.
  37. *   email: cmaae47 @ ic.ac.uk (Thomas Sippel - Dau) (uk.ac.ic on Janet)
  38. *   voice: +44 71 589 5111 x4937 or 4934 (day), or +44 71 823 9497 (fax)
  39. *   snail: Imperial College of Science, Technology and Medicine
  40. *   The Center for Computing Services, Kensington SW7 2BX, Great Britain
  41.