Advertisement
echampagne1

Untitled

Oct 24th, 2014
155
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.85 KB | None | 0 0
  1. #! /bin/bash
  2.  
  3. declare -a hist
  4.  
  5. while [[ true ]]; do
  6. hist[0]=$(pwd)
  7.  
  8. list=$( ls -l | grep '^d' | egrep -v '^total' | awk '{print $1, $2, $4, $5, $6, $8}' )
  9. dir=$( echo */ )
  10. echo "##########################################################################"
  11. echo $hist
  12. echo "$list"
  13.  
  14.  
  15.  
  16. select choice in quit back jump $dir; do
  17. if [[ $choice == "quit" ]]; then
  18. echo "Thank you for navigating"
  19. exit 0
  20.  
  21. elif [[ $choice == "jump" ]]; then
  22.  
  23. echo "Which directory would you like to go to? "
  24. echo $dir
  25. read name
  26. cd $name
  27. ls
  28.  
  29. break
  30. elif [[ $choice == "back" ]]; then
  31. cd -
  32. break
  33. else
  34. cd $choice
  35. if [[ $hist == ${hist[$i]} ]]; then
  36. unset hist[$1]
  37.  
  38. fi
  39. break
  40. fi
  41. done
  42. done
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement