Advertisement
Guest User

Untitled

a guest
May 19th, 2014
382
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.51 KB | None | 0 0
  1. #! /bin/sh
  2. DATE=`date | awk -F" " '{print $3}'`
  3.  
  4. case "$1" in
  5. mes)
  6. cal | head -n1
  7. ;;
  8. semana)
  9. gcal -i -s 1 | head -n3 | tail -n1 | tr 'visá' 'vi sa'
  10. ;;
  11. pasado)
  12. gcal -i -s 1 | grep -v '[a-zA-Z]' | grep '[0-9]' | tr "<" " " | tr ">" " "| awk -F$DATE ' BEGIN {i=0}
  13. ($1 == $0 && i==0) {print $1}($1 != $0 && i==0){i=i+1;print $1}';
  14. ;;
  15. hoy)
  16. echo $DATE;
  17. ;;
  18. futuro)
  19. gcal -i -s 1 | grep -v '[a-zA-Z]' | grep '[0-9]' | tr "<" " " | tr ">" " "| awk -F$DATE ' BEGIN {i=1}
  20. (i==0) {print $0}($1 != $0 && i==1){i=i-1;print $2}';
  21. ;;
  22. esac
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement