Skip to content

Commit b375890

Browse files
committed
Rewrite indent_text in pure bash
1 parent be7a609 commit b375890

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

main.sh

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -203,9 +203,12 @@ declare -Agr C=( # Pre-defined colors
203203
indent_text() {
204204
local -i IndentSize=${1}
205205
shift
206-
pr -e -t -o ${IndentSize} <<< "$(
207-
printf "%s\n" "$@"
208-
)"
206+
local IndentString
207+
printf -v IndentString "%*s" "${IndentSize}" ""
208+
local line
209+
while IFS= read -r line; do
210+
printf '%s%s\n' "${IndentString}" "${line}"
211+
done <<< "$(printf '%s\n' "$@")"
209212
}
210213

211214
get_system_info() {

0 commit comments

Comments
 (0)