Advertisement
Guest User

Untitled

a guest
Apr 25th, 2017
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.57 KB | None | 0 0
  1. #/usr/bin/env bash
  2.  
  3. function cdroot()
  4. {
  5. while [[ $PWD != '/' && $(dirname `dirname $PWD`) != "$HOME/Documents/TA/netsec2017" ]]; do cd ..; done
  6. }
  7.  
  8. alias prev='cd ../"$(ls -F .. | grep '/' | grep -B1 -xF "${PWD##*/}/" | head -n 1)"'
  9. alias next='cd ../"$(ls -F .. | grep '/' | grep -A1 -xF "${PWD##*/}/" | tail -n 1)"'
  10.  
  11. function ne
  12. {
  13. cdroot
  14. next
  15. ID=$(ls ../ | grep -e "^s[0-9]*" | grep -n `basename $PWD` | cut -d: -f1)
  16. TOTAL=$(ls ../ | grep -e "^s[0-9]*" | wc -l)
  17. echo $ID "/" $TOTAL
  18. grep "Name: " s*.txt
  19. }
  20. function n
  21. {
  22. ne
  23. op
  24. }
  25. function op
  26. {
  27. killall -9 atom
  28. atom -a s*.txt
  29. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement