Created
March 17, 2019 16:23
-
-
Save robshep/570ec46cf173927c2585d838a1f91342 to your computer and use it in GitHub Desktop.
Highlight a character at a position
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Inserts a single Red background highlight at the chosen character position | |
# usage: hl -c <pos> <file> | |
# | |
# E.g. /usr/local/bin/hl -c 384 /tmp/query.sql | |
head $1 $2 $3; \ | |
gecho -e -n "\e[41m"; \ | |
tail $1 +`expr $2 + 1` $3 | head -c 1; \ | |
gecho -e -n "\e[0m"; \ | |
tail $1 +`expr $2 + 2` $3 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment