Fix banner
This commit is contained in:
@@ -16,11 +16,45 @@ if [[ -v DEBUG ]]; then
|
|||||||
banner="banner.sh"
|
banner="banner.sh"
|
||||||
else
|
else
|
||||||
banner="$profiledir/banner.sh"
|
banner="$profiledir/banner.sh"
|
||||||
[[ -f ./functions ]] && cp functions "$profiledir"
|
[[ -f ./functions ]] && cp -f functions "$profiledir"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
cat <<- 'EOF' > "$banner"
|
cat <<- 'EOF' > "$banner"
|
||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
|
if ! type -t readarray >/dev/null; then
|
||||||
|
readarray() {
|
||||||
|
local cmd opt t v=MAPFILE
|
||||||
|
while [ -n "$1" ]; do
|
||||||
|
case "$1" in
|
||||||
|
-h|--help) echo "minimal substitute readarray for older bash"; exit; ;;
|
||||||
|
-r) shift; opt="$opt -r"; ;;
|
||||||
|
-t) shift; t=1; ;;
|
||||||
|
-u)
|
||||||
|
shift;
|
||||||
|
if [ -n "$1" ]; then
|
||||||
|
opt="$opt -u $1";
|
||||||
|
shift
|
||||||
|
fi
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
if [[ "$1" =~ ^[A-Za-z_]+$ ]]; then
|
||||||
|
v="$1"
|
||||||
|
shift
|
||||||
|
else
|
||||||
|
echo -en "${C_BOLD}${C_RED}Error: ${C_RESET}Unknown option: '$1'\n" 1>&2
|
||||||
|
exit
|
||||||
|
fi
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
done
|
||||||
|
cmd="read $opt"
|
||||||
|
eval "$v=()"
|
||||||
|
while IFS= eval "$cmd line"; do
|
||||||
|
line=$(echo "$line" | sed -e "s#\([\"\`]\)#\\\\\1#g" )
|
||||||
|
eval "${v}+=(\"$line\")"
|
||||||
|
done
|
||||||
|
}
|
||||||
|
fi
|
||||||
echo -n '
|
echo -n '
|
||||||
_ _ _ _ _
|
_ _ _ _ _
|
||||||
| | | | | | | | | |
|
| | | | | | | | | |
|
||||||
|
|||||||
Reference in New Issue
Block a user