Advertisement
emcek

emerge-current.sh

Nov 5th, 2011
179
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.67 KB | None | 0 0
  1. emc@meee ~/bin $ cat emerge-current.sh
  2. #!/bin/bash
  3. # emerge-current.sh by Hellf[i]re
  4. #
  5. # This script is designed to read the name of the last package compiled.
  6. #
  7. # As this script does read the entirety of emerge.log, it will be rather
  8. # heavy on the CPU. It shouldn't be enough to be noticable on newer (2.0Ghz+)
  9. # processors, but it still should not be run more often than every 30 seconds.
  10. #
  11. # Usage:
  12. # .conkyrc: ${execi [time] /path/to/script/emerge-current.sh}
  13. #
  14. # Usage Example
  15. # ${execi 30 /home/youruser/scripts/emerge-current.sh}
  16.  
  17. tac /var/log/emerge.log |\
  18. grep 'Compiling' |\
  19. head |\
  20. sed -e 's/.*(//' |\
  21. sed -e 's/::.*)//' |\
  22. head -n 1 |\
  23. cut -d \) -f 1
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement