Advertisement
Guest User

cd_dropbox

a guest
Sep 13th, 2017
1,109
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.79 KB | None
  1. #!/bin/bash
  2.  
  3. ##Author: John Mark Isaac Madison
  4. ##Email : HeavyMetalCookies@Gmail.com
  5.  
  6. ##Script was developed for Git Bash on Windows 10.
  7. ##It successfully queries if the dropdox folder
  8. ##exists, and navigates to the dropbox directory.
  9.  
  10. echo "TEST #1:----------------------------------"
  11. echo $PWD
  12. wtf=$(pwd)  ##wtf="$pwd" | Version does not work.
  13. cd ~/Dropbox/
  14. echo $PWD
  15. cd "$wtf"
  16. echo "DIR:"$PWD
  17.  
  18. echo "TEST #2:----------------------------------"
  19. dbox="~/Dropbox/"
  20. eval "cd $dbox"
  21. echo $PWD
  22.  
  23. echo "TEST #3:----------------------------------"
  24. prv=$(pwd) && eval "cd $dbox" && echo "YES" && cd "$prv"
  25.  
  26.  
  27. echo "TEST #4:----------------------------------"
  28. dbox="~/Dropbox/"
  29. result=0
  30. prv=$(pwd) && eval "cd $dbox" && result=1 && cd "$prv"
  31. echo $result
  32.  
  33. read -p "Press Enter To Continue:"
Advertisement
RAW Paste Data Copied
Advertisement