I tend to visit the same directories during the course of a workday. Using the dirs -v command I can keep a list in a file
dirs -v > last-lines.txt
I would like to be able to re-read this file in a new terminal and pushd to each directory on the line. What I have is
cat ~/last-list.txt | while read line; do pushd $line; done
the issue I am having is that the '~' is not expanded and as a result the pushd fails with
-bash: pushd: ~/director-name: No such file or directory
Is there anyway to force '~' to be expanded to the full path, or a smarter way to accomplish the above?
Thanks