home *** CD-ROM | disk | FTP | other *** search
/ The Datafile PD-CD 5 / DATAFILE_PDCD5.iso / utilities / p / psh / c / pwd < prev    next >
Encoding:
Text File  |  1995-05-08  |  329 b   |  25 lines

  1. /* vi:tabstop=4:shiftwidth=4:smartindent
  2.  *
  3.  * pwd.c - print the current working directory
  4.  *
  5.  */
  6.  
  7. #include <stdio.h>
  8. #include <unistd.h>
  9. #include "psh.h"
  10.  
  11. int    sh_pwd(int argc, char **argv)
  12. {
  13.     char    tmp[MAXLEN];
  14.  
  15.     if (argc != 1)
  16.     {
  17.         fprintf(stderr, "Usage: pwd\n");
  18.         return 1;
  19.     }
  20.     getcwd(tmp, MAXLEN);
  21.     puts(tmp);
  22.     return 0;
  23. }
  24.  
  25.