Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #! /bin/bash
- declare -a hist
- while [[ true ]]; do
- hist[0]=$(pwd)
- list=$( ls -l | grep '^d' | egrep -v '^total' | awk '{print $1, $2, $4, $5, $6, $8}' )
- dir=$( echo */ )
- echo "##########################################################################"
- echo $hist
- echo "$list"
- select choice in quit back jump $dir; do
- if [[ $choice == "quit" ]]; then
- echo "Thank you for navigating"
- exit 0
- elif [[ $choice == "jump" ]]; then
- echo "Which directory would you like to go to? "
- echo $dir
- read name
- cd $name
- ls
- break
- elif [[ $choice == "back" ]]; then
- cd -
- break
- else
- cd $choice
- if [[ $hist == ${hist[$i]} ]]; then
- unset hist[$1]
- fi
- break
- fi
- done
- done
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement