If the file contains more than one line, only the first line is assigned to the variable. If there is more than one parameter to the read , then each variable gets assigned a successive whitespace delineated string. The final variable gets the remainder of the line. When hash is called with no arguments, it simply lists the commands that have been hashed. A pushdown stack is used to keep track of directory names.
Options allow various manipulations of the directory stack.
A successful pushd or popd will automatically invoke dirs . Scripts that require various changes to the current working directory without hard-coding the directory name changes can make good use of these commands. Now, do some stuff in directory 'dir1'. Now, do some stuff in directory 'dir2'. It is useful in situations when multiple scripts use a common data file or function library.