Skip to content

Commit 67398ee

Browse files
authored
Fix syntax errors bashrc file
1 parent 8d9361f commit 67398ee

File tree

1 file changed

+16
-18
lines changed

1 file changed

+16
-18
lines changed

du_setup.sh

Lines changed: 16 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1074,7 +1074,7 @@ configure_custom_bashrc() {
10741074
fi
10751075
chmod 600 "$temp_source_bashrc"
10761076

1077-
if ! cat > "$temp_source_bashrc" <<'EOF'
1077+
if ! cat > "$temp_source_bashrc" <<'EOF'; then
10781078
# shellcheck shell=bash
10791079
# ===================================================================
10801080
# Universal Portable .bashrc for Modern Terminals
@@ -1839,7 +1839,7 @@ bashhelp() {
18391839
18401840
case "$category" in
18411841
all|"")
1842-
cat << 'EOF'
1842+
cat << 'HELPTEXT'
18431843
18441844
╔════════════════════════════════════════════════════════╗
18451845
║ .bashrc - Quick Reference ║
@@ -2025,11 +2025,11 @@ APT (Debian/Ubuntu):
20252025
💡 TIP: Most commands support --help or -h for more information
20262026
The prompt shows: ✗ for failed commands, git branch when in repo
20272027
2028-
EOF
2028+
HELPTEXT
20292029
;;
20302030
20312031
navigation)
2032-
cat << 'EOF'
2032+
cat << 'HELPTEXT'
20332033
20342034
═══ NAVIGATION & DIRECTORY COMMANDS ═══
20352035
@@ -2049,11 +2049,11 @@ Examples:
20492049
up 3 # Go up 3 levels
20502050
cd - # Return to previous directory
20512051
2052-
EOF
2052+
HELPTEXT
20532053
;;
20542054
20552055
files)
2056-
cat << 'EOF'
2056+
cat << 'HELPTEXT'
20572057
20582058
═══ FILE OPERATION COMMANDS ═══
20592059
@@ -2081,11 +2081,11 @@ Examples:
20812081
extract data.tar.gz
20822082
backup ~/.bashrc
20832083
2084-
EOF
2084+
HELPTEXT
20852085
;;
20862086
20872087
system)
2088-
cat << 'EOF'
2088+
cat << 'HELPTEXT'
20892089
20902090
═══ SYSTEM MONITORING COMMANDS ═══
20912091
@@ -2116,11 +2116,11 @@ Examples:
21162116
psgrep nginx
21172117
psmem | grep docker
21182118
2119-
EOF
2119+
HELPTEXT
21202120
;;
21212121
21222122
docker)
2123-
cat << 'EOF'
2123+
cat << 'HELPTEXT'
21242124
21252125
═══ DOCKER COMMANDS ═══
21262126
@@ -2155,11 +2155,11 @@ Examples:
21552155
dcupdate nginx
21562156
dcgrep app "error"
21572157
2158-
EOF
2158+
HELPTEXT
21592159
;;
21602160
21612161
git)
2162-
cat << 'EOF'
2162+
cat << 'HELPTEXT'
21632163
21642164
═══ GIT SHORTCUTS ═══
21652165
@@ -2178,11 +2178,11 @@ Examples:
21782178
gc -m "Update docs" # Commit
21792179
gp # Push to remote
21802180
2181-
EOF
2181+
HELPTEXT
21822182
;;
21832183
21842184
network)
2185-
cat << 'EOF'
2185+
cat << 'HELPTEXT'
21862186
21872187
═══ NETWORK COMMANDS ═══
21882188
@@ -2199,7 +2199,7 @@ Examples:
21992199
listening | grep 80
22002200
ping google.com
22012201
2202-
EOF
2202+
HELPTEXT
22032203
;;
22042204
22052205
*)
@@ -2237,7 +2237,6 @@ alias commands='compgen -A function -A alias | grep -v "^_" | sort | column'
22372237
# - Consider moving rarely-used functions to separate files
22382238
# - Use 'time bash -i -c exit' to measure startup time
22392239
EOF
2240-
then
22412240
print_error "Failed to write .bashrc content to temporary file $temp_source_bashrc."
22422241
log "Critical error: Failed to write bashrc content to $temp_source_bashrc."
22432242
rm -f "$temp_source_bashrc" 2>/dev/null
@@ -2248,8 +2247,7 @@ EOF
22482247

22492248
local temp_fallback_path="/tmp/custom_bashrc_for_${USERNAME}.txt"
22502249

2251-
if ! tee "$BASHRC_PATH" < "$temp_source_bashrc" > /dev/null
2252-
then
2250+
if ! tee "$BASHRC_PATH" < "$temp_source_bashrc" > /dev/null; then
22532251
print_error "Failed to automatically write custom .bashrc to $BASHRC_PATH."
22542252
log "Error writing custom .bashrc for $USERNAME to $BASHRC_PATH (likely permissions issue)."
22552253

0 commit comments

Comments
 (0)