Skip to content

Instantly share code, notes, and snippets.

@dcode
Forked from jeffgeiger/brocolor.sh
Last active August 29, 2015 14:06
Show Gist options
  • Select an option

  • Save dcode/ed34fc1fdd22831a38e5 to your computer and use it in GitHub Desktop.

Select an option

Save dcode/ed34fc1fdd22831a38e5 to your computer and use it in GitHub Desktop.
#!/bin/bash
cat $1 | sed 's/#fields\t\|#types\t//g' | grep -v "^#" | awk 'BEGIN {FS="\t"; OFS=FS};{for(i=1;i<=NF;i++) printf("\x1b[%sm%s\x1b[0m%s",(i%7)+31,$i,OFS); print ""}'
@dcode
Copy link
Author

dcode commented Sep 9, 2014

Updated awk to use tab separated output.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment