From bbea5e871c584f9c9f52c1c7bdffdd1b030a1af2 Mon Sep 17 00:00:00 2001 From: Asif Bacchus Date: Fri, 14 Aug 2020 00:02:36 -0600 Subject: [PATCH] add textblock formatting functions --- .vscode/numbered-bookmarks.json | 18 +++++++++++++++++- pilerBackup/pilerbackup.sh | 12 ++++++++++++ 2 files changed, 29 insertions(+), 1 deletion(-) diff --git a/.vscode/numbered-bookmarks.json b/.vscode/numbered-bookmarks.json index 4c08963..c4067aa 100644 --- a/.vscode/numbered-bookmarks.json +++ b/.vscode/numbered-bookmarks.json @@ -1,3 +1,19 @@ { - "bookmarks": [] + "bookmarks": [ + { + "fsPath": "$ROOTPATH$/pilerBackup/pilerbackup.sh", + "bookmarks": [ + -1, + 113, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1 + ] + } + ] } \ No newline at end of file diff --git a/pilerBackup/pilerbackup.sh b/pilerBackup/pilerbackup.sh index 05566c8..8b39610 100755 --- a/pilerBackup/pilerbackup.sh +++ b/pilerBackup/pilerbackup.sh @@ -184,6 +184,18 @@ stamp () { (date +%F" "%T) } +textblock() { + printf "%s\n" "$1" | fold -w "$width" -s +} + +switchTextblock() { + printf "%s%s%s\n" "$yellow" "$1" "$norm" +} + +newline() { + printf "\n" +} + # same as exitError but for signal captures trapExit () { printf "${err}[%s] -- [ERROR] 99: Caught signal --${norm}\n" \