I need to use pushd and popd to navigate all of the subdirectories in my current directory.
I know how to get into each subdirectory, add it to the stack, and pop back out, but i cant figure out how to get into subdirectories deeper than the first without adding a foreach and if statement for each level.
If there a while loop solution to this?
foreach x (`ls`)
if(-d $x)then
pushd $x
echo $x
popd
endif
end
I am working in UNIX