0x0049 icon

divider

0x0049 | PRO | 02/14/17 05:16:15 PM UTC | 0 ⭐ | 209 👁️ | Never ⏰ | []
Bash |

670 B

|

None

|

0 👍

/

0 👎

#!/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 "$@"

Comments

  •  icon
    01/01/70 12:00:00 AM UTC
    Plain Text |

    0 B

    |

    👍

    /

    👎