Advertisement
Guest User

Untitled

a guest
Oct 18th, 2019
108
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.40 KB | None | 0 0
  1. # Bash - Split Path
  2.  
  3. Easy tool to split the current $PATH of the system into individual lines.
  4.  
  5. ```bash
  6. #!/bin/bash
  7. {
  8.  
  9. for i in $(echo "$PATH" | sed 's/:/ /g'); do echo $i; done;
  10.  
  11. } || echo "Failed."; exit 127;
  12. ```
  13.  
  14. ## Example
  15. ```
  16. ExampleStation:~ genuser1$ for i in $(echo "$PATH" | sed 's/:/ /g'); do echo $i; done;
  17. /usr/local/opt/llvm/bin
  18. /usr/bin
  19. /bin
  20. /usr/sbin
  21. /sbin
  22. /usr/local/bin
  23. /usr/local/go/bin
  24. ```
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement