Applying style to your terminal session with awk
, CSS style!
After downloading this repository, add the following to your ~/.bashrc
file¹ (the script needs to be sourced because it is implemented as a shell function):
. awkcss.bash
Don't look at me This is a quote I need it, for multiple lines
The simplest use is to specify the awkcss inline:
awkcss 'BEGIN { color(red); } NR % 2 == 0 { color(green); }' defaults.awkcss
Print the start of the README from this repository using the MarkDown example:
head -n 35 README.md | awkcss -f examples/markdown.awkcss
The -f
argument (file) takes relative or absolute paths. Use the -s
argument (system) to resolves the path relative to the location of this repository. Use this to refer to the examples from anywhere:
cd # go to home folder
awkcss -s examples/zebra.awkcss < .profile # ¹
For a complete description of the AWKCSS language, see the Reference.
Compatiblity is intended with all awk
variants, including the original implementation by Aho, Kernighan and Weinberger.
Optional:
- When using TextMate (or compatible editor), you could install AWK syntax highlighting.
- Installing ok-bash will enhance your experience while working with this repository (while making you smarter in the process).
¹) or your other favourite startup file.