home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #16 / NN_1992_16.iso / spool / comp / unix / programm / 4034 < prev    next >
Encoding:
Text File  |  1992-07-31  |  1.1 KB  |  36 lines

  1. Newsgroups: comp.unix.programmer
  2. Path: sparky!uunet!uunet.ca!geac!r-node!pseudo!mjn
  3. From: mjn@pseudo.uucp (Murray Nesbitt)
  4. Subject: Re: expanding ~'s in a directory name.
  5. Organization: Private system in Toronto, ON
  6. Date: Fri, 31 Jul 1992 12:37:05 GMT
  7. Message-ID: <MJN.92Jul31043705@pseudo.uucp>
  8. In-Reply-To: aroll@gucis.cit.gu.edu.au's message of 29 Jul 92 01:26:29 GMT
  9. References: <1992Jul29.012629.14000@gucis.cit.gu.edu.au>
  10. Sender: mjn@pseudo.uucp (Murray Nesbitt)
  11. Lines: 23
  12.  
  13.  
  14. In article <1992Jul29.012629.14000@gucis.cit.gu.edu.au> aroll@gucis.cit.gu.edu.au (Ashley Roll) writes:
  15.  
  16. >My problem is how do I expand ~'s. I want to expand then the way that csh does
  17.  
  18. >Has anyone written or got code that will do this that I can use? Or is there
  19. >a library function that will do this.
  20.  
  21. I don't care^H^H^H^Hknow about the csh, but the following should work
  22. with sh and ksh:
  23.  
  24. #include <stdlib.h>
  25.  
  26. char *expanded_tilde;
  27.  
  28.     expanded_tilde = getenv("HOME");
  29.  
  30.  
  31. To be completely honest, it should work under the csh, too.
  32.  
  33. Murray
  34. -- 
  35. Until my site's in the maps, please reply to "druid!pseudo!mjn".
  36.