Want more features on Pastebin? Sign Up, it's FREE!
Guest

Highlight whitespace on the terminal

By: a guest on Jul 14th, 2011  |  syntax: Bash  |  size: 0.24 KB  |  views: 71  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. #! /bin/sh
  2. # Highlight whitespace on the terminal
  3. #  -- rolfwr
  4. reset=$(printf '\033[0m')
  5. color=$(printf '\033[0;36m')
  6.  
  7. cat $@ | sed -e "
  8. s/      /${color}▹▹▹▹▹▹▹▹${reset}/g
  9. s/ /${color}·${reset}/g
  10. s/$/${color}${reset}/"
clone this paste RAW Paste Data