#!/bin/bash # usage: divider /path/to/file # I use this when monitoring an error log file during development so # I can tell when there is a new error and where that errors starts. # Edit: I now use multitail instead to show an alert when there is an error # and filter out data I don't want to see. https://pastebin.com/XJQjU3Cv # Outputs a divider into a file (defaults to the Apache error log). function main() { local file=${1:-/var/log/apache2/error.log} local columns=$(tput cols) # See https://en.wikipedia.org/wiki/List_of_Unicode_characters#Box_Drawing # for other characters you could use. printf '%0.s░' $(seq 1 $columns) >> $file } main "$@"