Last active
September 29, 2022 00:39
-
-
Save tonejito/2c93eb0d55fbfb06470933f03aaff055 to your computer and use it in GitHub Desktop.
Full width separator with Perl or (bash) shell magic
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SHELL=/bin/bash | |
# = ^ . ^ = | |
SEP?=- | |
COLS=$(shell tput cols) | |
.PHONY: separator test | |
test: | |
@$(MAKE) -s separator | |
@$(MAKE) -s separator SEP=# | |
@SEP=_ $(MAKE) -s separator | |
@SEP== $(MAKE) -s separator | |
@SEP=+ make -s separator SEP=* | |
separator: | |
@(which perl &>/dev/null && perl -e 'print("${SEP}" x ${COLS} . "\n")' || for i in {1..${COLS}} ; do printf '${SEP}' ; done ; echo '') |
Author
tonejito
commented
Dec 16, 2019
•
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment