home *** CD-ROM | disk | FTP | other *** search
/ ARM Club 3 / TheARMClub_PDCD3.iso / hensa / unix / unixcmds_1 / BIN / pushd < prev    next >
Encoding:
Text File  |  1993-06-10  |  327 b   |  13 lines

  1. # vi:si:ts=4:sw=4
  2. # Implements pushd using a system Variable (DIRSTACK) to store the stack.
  3.  
  4. die "Usage: pushd directory\n" unless ($#ARGV == 0);
  5.  
  6. $dirs = $ENV{"FS\$Full"}." ".$ENV{"DIRSTACK"};
  7.  
  8. die "Dir stack too full\n" unless (length($dirs) < 240);
  9.  
  10. $dirs =~ s/</|</g;
  11. system("Set DIRSTACK $dirs");
  12. system("%dir $ARGV[0]");
  13.