package Psh
::Builtins
::Dirs
;
require Psh
::Support
::Dirs
;
Prints out [the last n] entries in the cd history
my $max=$#Psh::Support
::Dirs
::stack
;
if ($_[0] && $_[0]=~/^\d+$/) {
$max=$_[0]-1 if $_[0]<=$max;
for (my $i=$max; $i>=0; $i--) {
if ($i==$Psh::Support
::Dirs
::::stack_pos
) {
print $Psh::Support
::Dirs
::stack
[$i]."\n";