Advertisement
AndCycle

mailme.sh

May 21st, 2020
1,575
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.40 KB | None | 0 0
  1. #!/bin/bash
  2.  
  3. TITLE="$1"
  4.  
  5. if [ -t 0 ]; then
  6.     ### guessing, open to tty probably means no stdin and waiting for input
  7.  
  8.     TTY=$(tty)
  9.     echo "$TTY done" | mail -s "$0 $TITLE $TTY" "$USER"
  10. else
  11.     pee 'fold --spaces | tr "\r\n" "\275\276" | tr -d "[:cntrl:]" | tr "\275\276" "\r\n" | pee "head -n 100; printf \".%.0s\" {1..80}; echo" "tail -n 100" | mail -s "$0 $TITLE" "$USER"' 'cat -'
  12. fi
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement