Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # $(1) = title; $(2) = color
- define draw_line
- @ \
- printf '%.0s-' {1..$(shell tput cols)}; \
- if test "$(1)"; then \
- cols=$(shell tput cols); \
- length=$(shell echo $(1) | awk '{print length}'); \
- let indent="cols - (cols - length) / 2"; \
- tput cub $$indent; \
- test "$(2)" && printf $$(tput setaf $(2)); \
- printf '$(1)'; \
- test "$(2)" && printf $$(tput sgr0); \
- fi; \
- echo
- endef
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement