Não pode escolher mais do que 25 tópicos Os tópicos devem começar com uma letra ou um número, podem incluir traços ('-') e podem ter até 35 caracteres.
 
 
 
 

30 linhas
814 B

  1. #!/usr/bin/env bash
  2. # Run notmuch with a search term and clean up the output.
  3. HFILE=$HOME"/.cache/notmuch_search_hist"
  4. SEARCH=$HOME"/.cache/notmuch_search_res"
  5. if [ ! -e "$HFILE" ]; then
  6. touch "$HFILE"
  7. fi
  8. export HISTCONTROL=ignoreboth
  9. history -r "$HFILE"
  10. # Uncomment to use the Vi mode in readline:
  11. # set -o vi
  12. x=""
  13. echo > $SEARCH
  14. echo "Enter a search term to find with notmuch:"
  15. read -e x
  16. history -s "$x"
  17. notmuch search --output=messages "$x" > "$SEARCH"
  18. cat "$SEARCH" |
  19. sed 's/^id:\(.*\)/\1|/' | # remove the initial "id:"
  20. sed 's/\+/\\+/' | # replace "+" with "\+"
  21. sed 's/\$/\\\$/' | # replace "$" with "\$"
  22. tr -d "\n" | # remove newlines
  23. sed 's/.$//' | # remove the last redundant "|"
  24. cat > "$SEARCH"
  25. history -w "$HFILE"