ckpath 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. rm -f ../bin/x_tpath x_tpath
  2. echo 'Checking out your $PATH; . and $ACK/bin should be in front ...'
  3. echo "echo $$" >../bin/x_tpath
  4. rm -f x_tpath
  5. chmod +x ../bin/x_tpath
  6. case x`(x_tpath) 2>/dev/null`
  7. in
  8. x$$)
  9. STAT=0 ;;
  10. x)
  11. (cd ../bin ; echo Sorry, `pwd` is not in your shell PATH" ($PATH)")
  12. STAT=1 ;;
  13. *)
  14. echo "Sorry, there is something wrong with your PATH ($PATH)" ;;
  15. esac
  16. echo "echo t_$$" > X_Y_Z_
  17. chmod +x X_Y_Z_
  18. case x`X_Y_Z_`
  19. in
  20. xt_$$)
  21. ;;
  22. x)
  23. (cd ../bin ; echo Sorry, . is not in your shell PATH" ($PATH)")
  24. STAT=2 ;;
  25. *)
  26. echo "Sorry, there is something wrong with your PATH ($PATH)" ;;
  27. esac
  28. rm -f X_Y_Z_
  29. case $STAT
  30. in
  31. 2)
  32. ;;
  33. *)
  34. hash -r ;;
  35. esac
  36. echo "echo l_$$" >x_tpath
  37. chmod +x x_tpath
  38. case x`(x_tpath) 2>/dev/null`
  39. in
  40. xl_$$)
  41. ;;
  42. x)
  43. (cd ../bin ; echo Sorry, . is not in your shell PATH" ($PATH)")
  44. STAT=2 ;;
  45. x$$)
  46. echo Sorry, . is not in your PATH" ($PATH)" or after the ACK bin directory
  47. STAT=3 ;;
  48. *)
  49. echo "Sorry, there is something wrong with your PATH ($PATH)"
  50. STAT=4 ;;
  51. esac
  52. rm -f ../bin/x_tpath x_tpath
  53. echo "echo 93" > ../bin/cat
  54. chmod +x ../bin/cat
  55. hash -r
  56. case x`cat < /dev/null 2>/dev/null`
  57. in
  58. x93)
  59. rm -f ../bin/cat
  60. ;;
  61. *)
  62. rm -f ../bin/cat
  63. (cd ../bin ; echo Sorry, `pwd` comes too late in your PATH" ($PATH)" )
  64. STAT=13
  65. ;;
  66. esac
  67. exit $STAT