Fix syntax errors bashrc file

This commit is contained in:
buildplan
2025-10-20 15:26:57 +01:00
committed by GitHub
parent 8d9361fa88
commit 67398ee8e0

View File

@@ -1074,7 +1074,7 @@ configure_custom_bashrc() {
fi fi
chmod 600 "$temp_source_bashrc" chmod 600 "$temp_source_bashrc"
if ! cat > "$temp_source_bashrc" <<'EOF' if ! cat > "$temp_source_bashrc" <<'EOF'; then
# shellcheck shell=bash # shellcheck shell=bash
# =================================================================== # ===================================================================
# Universal Portable .bashrc for Modern Terminals # Universal Portable .bashrc for Modern Terminals
@@ -1839,7 +1839,7 @@ bashhelp() {
case "$category" in case "$category" in
all|"") all|"")
cat << 'EOF' cat << 'HELPTEXT'
╔════════════════════════════════════════════════════════╗ ╔════════════════════════════════════════════════════════╗
║ .bashrc - Quick Reference ║ ║ .bashrc - Quick Reference ║
@@ -2025,11 +2025,11 @@ APT (Debian/Ubuntu):
💡 TIP: Most commands support --help or -h for more information 💡 TIP: Most commands support --help or -h for more information
The prompt shows: ✗ for failed commands, git branch when in repo The prompt shows: ✗ for failed commands, git branch when in repo
EOF HELPTEXT
;; ;;
navigation) navigation)
cat << 'EOF' cat << 'HELPTEXT'
═══ NAVIGATION & DIRECTORY COMMANDS ═══ ═══ NAVIGATION & DIRECTORY COMMANDS ═══
@@ -2049,11 +2049,11 @@ Examples:
up 3 # Go up 3 levels up 3 # Go up 3 levels
cd - # Return to previous directory cd - # Return to previous directory
EOF HELPTEXT
;; ;;
files) files)
cat << 'EOF' cat << 'HELPTEXT'
═══ FILE OPERATION COMMANDS ═══ ═══ FILE OPERATION COMMANDS ═══
@@ -2081,11 +2081,11 @@ Examples:
extract data.tar.gz extract data.tar.gz
backup ~/.bashrc backup ~/.bashrc
EOF HELPTEXT
;; ;;
system) system)
cat << 'EOF' cat << 'HELPTEXT'
═══ SYSTEM MONITORING COMMANDS ═══ ═══ SYSTEM MONITORING COMMANDS ═══
@@ -2116,11 +2116,11 @@ Examples:
psgrep nginx psgrep nginx
psmem | grep docker psmem | grep docker
EOF HELPTEXT
;; ;;
docker) docker)
cat << 'EOF' cat << 'HELPTEXT'
═══ DOCKER COMMANDS ═══ ═══ DOCKER COMMANDS ═══
@@ -2155,11 +2155,11 @@ Examples:
dcupdate nginx dcupdate nginx
dcgrep app "error" dcgrep app "error"
EOF HELPTEXT
;; ;;
git) git)
cat << 'EOF' cat << 'HELPTEXT'
═══ GIT SHORTCUTS ═══ ═══ GIT SHORTCUTS ═══
@@ -2178,11 +2178,11 @@ Examples:
gc -m "Update docs" # Commit gc -m "Update docs" # Commit
gp # Push to remote gp # Push to remote
EOF HELPTEXT
;; ;;
network) network)
cat << 'EOF' cat << 'HELPTEXT'
═══ NETWORK COMMANDS ═══ ═══ NETWORK COMMANDS ═══
@@ -2199,7 +2199,7 @@ Examples:
listening | grep 80 listening | grep 80
ping google.com ping google.com
EOF HELPTEXT
;; ;;
*) *)
@@ -2237,7 +2237,6 @@ alias commands='compgen -A function -A alias | grep -v "^_" | sort | column'
# - Consider moving rarely-used functions to separate files # - Consider moving rarely-used functions to separate files
# - Use 'time bash -i -c exit' to measure startup time # - Use 'time bash -i -c exit' to measure startup time
EOF EOF
then
print_error "Failed to write .bashrc content to temporary file $temp_source_bashrc." print_error "Failed to write .bashrc content to temporary file $temp_source_bashrc."
log "Critical error: Failed to write bashrc content to $temp_source_bashrc." log "Critical error: Failed to write bashrc content to $temp_source_bashrc."
rm -f "$temp_source_bashrc" 2>/dev/null rm -f "$temp_source_bashrc" 2>/dev/null
@@ -2248,8 +2247,7 @@ EOF
local temp_fallback_path="/tmp/custom_bashrc_for_${USERNAME}.txt" local temp_fallback_path="/tmp/custom_bashrc_for_${USERNAME}.txt"
if ! tee "$BASHRC_PATH" < "$temp_source_bashrc" > /dev/null if ! tee "$BASHRC_PATH" < "$temp_source_bashrc" > /dev/null; then
then
print_error "Failed to automatically write custom .bashrc to $BASHRC_PATH." print_error "Failed to automatically write custom .bashrc to $BASHRC_PATH."
log "Error writing custom .bashrc for $USERNAME to $BASHRC_PATH (likely permissions issue)." log "Error writing custom .bashrc for $USERNAME to $BASHRC_PATH (likely permissions issue)."