Formats terminal commands without comments for copy/paste safety. Comments in command blocks break copy/paste functionality.
Terminal command blocks must NEVER contain comments. Comments break copy/paste functionality.
Correct Pattern:
Comments ARE allowed in saved script files using proper syntax:
# for comments# for comments-- for commentsBreak into sequential, discrete blocks - one action per block.
# Install HACS
wget -O - https://get.hacs.xyz | bash -
# Restart Home Assistant
ha core restart # This will take a minute
Install HACS:
wget -O - https://get.hacs.xyz | bash -
Restart Home Assistant (this will take about a minute):
ha core restart
When creating saved files (not direct terminal commands), comments ARE appropriate:
Shell script file (saved as script.sh):
#!/bin/bash
# This script backs up Home Assistant
# Usage: ./backup-ha.sh
BACKUP_DIR="/backup"
DATE=$(date +%Y%m%d)
# Create backup
ha backups new --name "backup-${DATE}"